[Python-Dev] enum instances (original) (raw)

Ethan Furman ethan at stoneleaf.us
Wed May 1 04:12:54 CEST 2013


On 04/30/2013 07:05 PM, Nikolaus Rath wrote:

Larry Hastings <larry at hastings.org> writes:

On 04/29/2013 07:42 PM, Nikolaus Rath wrote:

State is a class, it just inherits from enum. Thus:

type(State) == type(enum) == type(EnumMetaclass) issubclass(State, enum) == True

HTH, -Nikolaus If you'd tried it, you'd have found that that isn't true. enum has a metaclass, EnumMetaclass. Thus type(enum) == EnumMetaClass. That is exactly what I wrote above.

Not really. You wrote

type(enum) == type(EnumMetaClass)

not

type(enum) == EnumMetaClass

-- Ethan



More information about the Python-Dev mailing list