Lines Matching refs:enum_class
200 enum_class = super(EnumMeta, metacls).__new__(metacls, cls, bases, classdict)
201 enum_class._member_names_ = [] # names in random order
203 enum_class._member_map_ = OrderedDict()
205 enum_class._member_map_ = {} # name->value map
206 enum_class._member_type_ = member_type
209 enum_class._value2member_map_ = {}
216 __new__ = enum_class.__new__
226 enum_member = __new__(enum_class)
230 enum_member = __new__(enum_class, *args)
235 enum_member.__objclass__ = enum_class
239 for name, canonical_member in enum_class._member_map_.items():
245 enum_class._member_names_.append(member_name)
249 setattr(enum_class, member_name, enum_member)
251 enum_class._member_map_[member_name] = enum_member
256 enum_class._value2member_map_[value] = enum_member
277 _make_class_unpicklable(enum_class)
284 class_method = getattr(enum_class, name)
290 setattr(enum_class, name, enum_method)
297 if issubclass(enum_class, int):
298 setattr(enum_class, '__cmp__', getattr(int, '__cmp__'))
302 if issubclass(enum_class, int):
312 setattr(enum_class, method, getattr(int, method))
320 setattr(enum_class, '__member_new__', enum_class.__dict__['__new__'])
321 setattr(enum_class, '__new__', Enum.__dict__['__new__'])
322 return enum_class
467 enum_class = metacls.__new__(metacls, class_name, bases, classdict)
477 _make_class_unpicklable(enum_class)
479 enum_class.__module__ = module
481 return enum_class