how to make sortable datatype in Python?
--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Sunrise at the Stream
--
Chapters
00:00 How To Make Sortable Datatype In Python?
00:55 Accepted Answer Score 13
01:06 Thank you
--
Full question
https://stackoverflow.com/questions/4630...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #sorting #datastructures
#avk47
    Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Sunrise at the Stream
--
Chapters
00:00 How To Make Sortable Datatype In Python?
00:55 Accepted Answer Score 13
01:06 Thank you
--
Full question
https://stackoverflow.com/questions/4630...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #sorting #datastructures
#avk47
ACCEPTED ANSWER
Score 13
Check out http://wiki.python.org/moin/HowTo/Sorting/
You want to override __lt__ in your class for the built in sort function to work the way you described.