Message355607
So as far as possible, CPython only uses __lt__ ("<") element comparisons for its order-sensitive algorithms. This is documented for list.sort(), but the bisect and heapq modules strive to do the same.
The point is to minimize the number of comparison methods a new type needs to implement to participate (and "just one: __lt__" is ideal).
Your change would require they implement "__le__" too, so is unlikely to be accepted for CPython. |
|
Date |
User |
Action |
Args |
2019-10-29 03:27:53 | tim.peters | set | recipients:
+ tim.peters, Windson Yang |
2019-10-29 03:27:53 | tim.peters | set | messageid: <1572319673.55.0.716322154278.issue38626@roundup.psfhosted.org> |
2019-10-29 03:27:53 | tim.peters | link | issue38626 messages |
2019-10-29 03:27:53 | tim.peters | create | |
|