mirror of
https://github.com/python/cpython.git
synced 2025-11-03 15:11:34 +00:00
bpo-37685: Fixed __eq__, __lt__ etc implementations in some classes. (GH-14952)
They now return NotImplemented for unsupported type of the other operand.
This commit is contained in:
parent
4c69be22df
commit
662db125cd
23 changed files with 1295 additions and 1150 deletions
|
|
@ -2358,12 +2358,10 @@ def __init__(self, value=(), name=None, parent=None, two=False,
|
|||
|
||||
|
||||
def __eq__(self, other):
|
||||
if other is ANY:
|
||||
return True
|
||||
try:
|
||||
len_other = len(other)
|
||||
except TypeError:
|
||||
return False
|
||||
return NotImplemented
|
||||
|
||||
self_name = ''
|
||||
if len(self) == 2:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue