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 cool-RR
Recipients cool-RR
Date 2014-09-27.14:28:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1411828103.4.0.73202336425.issue22504@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-09-27 14:28:23cool-RRsetrecipients: + cool-RR
2014-09-27 14:28:23cool-RRsetmessageid: <1411828103.4.0.73202336425.issue22504@psf.upfronthosting.co.za>
2014-09-27 14:28:23cool-RRlinkissue22504 messages
2014-09-27 14:28:23cool-RRcreate