mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +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
|
@ -55,13 +55,8 @@ class OnlyInequality(object):
|
|||
def __ne__(self, other):
|
||||
return self is not other
|
||||
|
||||
class OnlyCmp(object):
|
||||
def __cmp__(self, other):
|
||||
return cmp(id(self), id(other))
|
||||
|
||||
class InheritedHashWithEquality(FixedHash, OnlyEquality): pass
|
||||
class InheritedHashWithInequality(FixedHash, OnlyInequality): pass
|
||||
class InheritedHashWithCmp(FixedHash, OnlyCmp): pass
|
||||
|
||||
class NoHash(object):
|
||||
__hash__ = None
|
||||
|
@ -74,7 +69,6 @@ class HashInheritanceTestCase(unittest.TestCase):
|
|||
fixed_expected = [FixedHash(),
|
||||
InheritedHashWithEquality(),
|
||||
InheritedHashWithInequality(),
|
||||
InheritedHashWithCmp(),
|
||||
]
|
||||
error_expected = [NoHash(),
|
||||
OnlyEquality(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue