[Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library

Tim Delaney timothy.c.delaney at gmail.com
Sun Apr 21 00:34:39 CEST 2013


On 21 April 2013 04:10, Barry Warsaw <barry at python.org> wrote:

> On Apr 13, 2013, at 08:37 AM, Tim Delaney wrote:
>
> >Just using definition order as the stable iteration order would do the
> >trick - no need for any comparisons at all. Subclasses (e.g. IntEnum) can
> >then override it.
>
> I think this isn't possible if we want to keep backward compatibility with
> earlier Pythons, which I want to do.


Do you want it compatible with Python 2.x? In that case I don't see a way
to do it - getting definition order relies on __prepare__ returning an
ordered dict, and __prepare__ of course is only available in 3.x.

Tim Delaney
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130421/57d19655/attachment.html>


More information about the Python-Dev mailing list