28 Dec
2020
28 Dec
'20
10:19 a.m.
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.