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/125594.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 libraryEthan Furman ethan at stoneleaf.us
Fri Apr 26 07:21:15 CEST 2013
On 04/25/2013 08:14 PM, Greg wrote:
> On 26/04/2013 1:28 p.m., Ethan Furman wrote:
>> Interesting idea, but why does Day(3) have to be disallowed to make it
>> work?
>
> Because it's ambiguous. Which day of the week is number 3? It
> depends on where you start.

Ah.


> I should perhaps point out that the numbers assigned to the
> values initially are just to establish the relative ordering.
> They wouldn't be directly accessible once the values are
> created. To get an integer value corresponding to a Day value,
> you would have to do arithmetic:
>
>     Day.wednesday - Day.sunday --> 3

That would make it very hard to do data storage and retrieval.

--
~Ethan~
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