[issue23591] enum: Add Flags and IntFlags

Ethan Furman report at bugs.python.org
Thu Sep 8 02:14:10 EDT 2016


Ethan Furman added the comment:

Vedran commented:
> This is something fundamental: it is breaking the promise that class body
> is a suite of commands, where Python statements (such as assignment) have
> their usual semantics.

I find it curious that you're okay with

>>> class Color(Enum):
...     red = 1
...
>>> Color.red == 1
False

But you find this completely incomprehensible

>>> class Color(Enum):
...    red = _auto_
...    blue = _auto_
...
>>> Color.red == Color.blue
False

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23591>
_______________________________________


More information about the Python-bugs-list mailing list