Message227678
I suggest making Enum members orderable, according to their order in the enum type. Currently trying to order them raises an exception:
>>> import enum
>>> class Number(enum.Enum):
... one = 1
... two = 2
... three = 3
>>> sorted((Number.one, Number.two))
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
sorted((Number.one, Number.two))
TypeError: unorderable types: Number() < Number()
If there's agreement from core developers that this is a good feature to add, I'll write a patch. |
|
Date |
User |
Action |
Args |
2014-09-27 14:28:23 | cool-RR | set | recipients:
+ cool-RR |
2014-09-27 14:28:23 | cool-RR | set | messageid: <1411828103.4.0.73202336425.issue22504@psf.upfronthosting.co.za> |
2014-09-27 14:28:23 | cool-RR | link | issue22504 messages |
2014-09-27 14:28:23 | cool-RR | create | |
|