コード例 #1
0
ファイル: enum.py プロジェクト: marcosptf/fedora
 def __new__(cls, name, bases, classdict, **options):
     enum_members = OrderedDict(classdict, __eq__=eq_enum)
     # We remove the Meta attribute from the class to not collide
     # with the enum values.
     enum_members.pop('Meta', None)
     enum = PyEnum(cls.__name__, enum_members)
     return SubclassWithMeta_Meta.__new__(cls, name, bases, OrderedDict(classdict, __enum__=enum), **options)
コード例 #2
0
 def __new__(cls, name, bases, classdict, **options):
     enum_members = OrderedDict(classdict, __eq__=eq_enum)
     # We remove the Meta attribute from the class to not collide
     # with the enum values.
     enum_members.pop("Meta", None)
     enum = PyEnum(cls.__name__, enum_members)
     return SubclassWithMeta_Meta.__new__(
         cls, name, bases, OrderedDict(classdict, __enum__=enum), **options)
コード例 #3
0
ファイル: enum.py プロジェクト: ekampf/graphene
 def __new__(cls, name, bases, classdict, **options):
     enum = PyEnum(cls.__name__, OrderedDict(classdict, __eq__=eq_enum))
     return SubclassWithMeta_Meta.__new__(cls, name, bases, OrderedDict(classdict, __enum__=enum), **options)
コード例 #4
0
 def __new__(cls, name, bases, classdict, **options):
     enum = PyEnum(cls.__name__, OrderedDict(classdict, __eq__=eq_enum))
     return SubclassWithMeta_Meta.__new__(
         cls, name, bases, OrderedDict(classdict, __enum__=enum), **options)