[Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library
barry at python.org
Thu Apr 25 20:50:12 CEST 2013
On Apr 23, 2013, at 10:24 AM, R. David Murray wrote:
>> >>> isinstance(C.a, C)
>> >>> isinstance(C(1), C)
>> It would really be better if instances were actual instances of the
>> class, IMO.
>The first False looks correct to me, I would not expect an enum value to be
>an instance of the class that holds it as an attribute.
>The second certainly looks odd, but what does it even mean to have an
>instance of an Enum class?
It only looks odd because it's using failed, duplicate, deprecated syntax.
Does this look similarly odd?
>>> isinstance(C, C)
given that ``C is C.a``?
More information about the Python-Dev