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/125336.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 libraryGuido van Rossum guido at python.org
Sat Apr 13 17:33:42 CEST 2013
[Eli]
>> It is applicable, in the sense that os.O_CREAT etc can be IntEnum values.
>> Their bitset operation results will be simple integers. It's not planned to
>> add a special enum for this - this was ruled against during the Pycon
>> discussions.

On Sat, Apr 13, 2013 at 7:30 AM, Serhiy Storchaka <storchaka at gmail.com> wrote:
> But IntEnum is useless in such cases because a resulting mask will be an
> integer an will lost its convenient printable representation. There is
> almost no benefit of IntEnum before int constant.

If you really wanted that you could define an int subclass that does
better and use that -- IntEnum is just one example of how you can
override the value type of Enum. (And yes, I am now +1 on documenting
this mechanism.)

--
--Guido van Rossum (python.org/~guido)
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