nomail at invalid.com
Fri Feb 5 02:12:09 EST 2016
I am looking the relationship between some classes
from the enum module
>>> from enum import EnumMeta, Enum
>>> class Color(Enum):
so EnumMeta is a metaclass, it is an instance of type
and inherit from type too.
so Enum is an instance of EnumMeta
and Enum inherit from object
so Color is an instance of EnumMeta and
inherit from Enum
It is not obvious to me that Color is an instance
of EnumMeta. Is it a python rule that if a class C
inherit from a class which is an instance of
a metaclass, then class C is an instance of the
same metaclass too ?
Or was it feasible to guess that ?
More information about the Python-list