A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-April/125414.html below:

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

[Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard libraryBarry Warsaw barry at python.org
Mon Apr 22 02:28:16 CEST 2013
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130421/10a9ae79/attachment-0001.pgp>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4