mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
removed Enum.__eq__ as it added nothing
This commit is contained in:
parent
82e9f32f17
commit
be3c2fea35
2 changed files with 11 additions and 5 deletions
|
@ -447,11 +447,6 @@ class Enum(metaclass=EnumMeta):
|
|||
return (['__class__', '__doc__', '__module__', 'name', 'value'] +
|
||||
added_behavior)
|
||||
|
||||
def __eq__(self, other):
|
||||
if type(other) is self.__class__:
|
||||
return self is other
|
||||
return NotImplemented
|
||||
|
||||
def __format__(self, format_spec):
|
||||
# mixed-in Enums should use the mixed-in type's __format__, otherwise
|
||||
# we can get strange results with the Enum name showing up instead of
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue