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

2013年4月21日 17:30:20 -0700

On Apr 22, 2013, at 09:02 AM, Nick Coghlan wrote:
>Iteration order matters a lot if you don't want people complaining about
>enums being broken:
>
> class Days(enum.Enum):
> Monday = 1
> Tuesday = 2
> Wednesday = 3
> Thursday = 4
> Friday = 5
> Saturday = 6
> Sunday = 7
Sorry, that's still not a complete use case. I don't see why you'd depend on
iteration order over Days for any particular functionality. Besides, if you
did, I think it would be better to derive Days from IntEnum and then iteration
order is guaranteed over the values.
-Barry

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to