This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author brandtbucher
Recipients brandtbucher, cheryl.sabella, mark.dickinson, rhettinger, serhiy.storchaka, tim.peters
Date 2019-02-24.14:22:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1551018132.1.0.568364924477.issue36095@roundup.psfhosted.org>
In-reply-to
Content
One other idea I had considered was having a new magic method intended to be used for elementwise comparisons such as these (I’m thinking specifically of the old __cmp__/tp_compare). Sorting routines could check for this method on each element, but fall back on __lt__ if it is missing or NotImplemented. 

This would allow us to define an ordering for types independent of the rich comparison behavior. Simply defining it for floats and adding quick patches for list.sort/min/max/... would provide the language (and users) with that flexibility.
History
Date User Action Args
2019-02-24 14:22:12brandtbuchersetrecipients: + brandtbucher, tim.peters, rhettinger, mark.dickinson, serhiy.storchaka, cheryl.sabella
2019-02-24 14:22:12brandtbuchersetmessageid: <1551018132.1.0.568364924477.issue36095@roundup.psfhosted.org>
2019-02-24 14:22:12brandtbucherlinkissue36095 messages
2019-02-24 14:22:12brandtbuchercreate