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:
Serhiy Storchaka 2019-08-08 08:42:54 +03:00 committed by GitHub
parent 4c69be22df
commit 662db125cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 1295 additions and 1150 deletions

View file

@ -2358,12 +2358,10 @@ class _Call(tuple):
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: