Paul Bryan via Python-Dev writes:

 > Should this be considered a bug in the Enum implementation?

Probably not.  The underlying implementation of Enums is integers, and
False and True *are* the integers 0 and 1 for most purposes.  And it
propagates further.  Same example:

>>> class Foo(enum.Enum):
...  A=True
...  B=1
...  C=0
...  D=False
... 
>>> Foo.B
<Foo.A: True>
>>> 

This amusing artifact was discussed in another thread recently.
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/PI3E3R5YWM4HGFLUQGNS327QD3AQXY4Q/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to