mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Issue #1717: Remove cmp. Stage 1: remove all uses of cmp and __cmp__ from
the standard library and tests.
This commit is contained in:
parent
191e850053
commit
a56c467ac3
32 changed files with 210 additions and 216 deletions
|
@ -10,7 +10,7 @@ class MyKey(object):
|
|||
def __hash__(self):
|
||||
return hash('mykey')
|
||||
|
||||
def __cmp__(self, other):
|
||||
def __eq__(self, other):
|
||||
# the following line decrefs the previous X.__mro__
|
||||
X.__bases__ = (Base2,)
|
||||
# trash all tuples of length 3, to make sure that the items of
|
||||
|
@ -18,7 +18,7 @@ class MyKey(object):
|
|||
z = []
|
||||
for i in range(1000):
|
||||
z.append((i, None, None))
|
||||
return -1
|
||||
return 0
|
||||
|
||||
|
||||
class Base(object):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue