summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_descr.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2008-08-11 15:45:58 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2008-08-11 15:45:58 (GMT)
commit48361f5cbf419cce361fd1aa0389d6304ad167db (patch)
treee3fb92982d5564830f6ce9a3f725acc51553ec50 /Lib/test/test_descr.py
parentf8d62d23e9b02c557b2bbe69f693fc14c2574281 (diff)
downloadcpython-48361f5cbf419cce361fd1aa0389d6304ad167db.zip
cpython-48361f5cbf419cce361fd1aa0389d6304ad167db.tar.gz
cpython-48361f5cbf419cce361fd1aa0389d6304ad167db.tar.bz2
Issue 2235: Py3k warnings are now emitted for classes that will no longer inherit a__hash__ implementation from a parent class in Python 3.x. The standard library and test suite have been updated to not emit these warnings.
Diffstat (limited to 'Lib/test/test_descr.py')
-rw-r--r--Lib/test/test_descr.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 53b7611..f170d59 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -1121,6 +1121,7 @@ order (MRO) for bases """
class G(object):
def __cmp__(self, other):
return 0
+ __hash__ = None # Silence Py3k warning
g = G()
orig_objects = len(gc.get_objects())
for i in xrange(10):
@@ -2727,6 +2728,7 @@ order (MRO) for bases """
if isinstance(other, int) or isinstance(other, long):
return cmp(self.value, other)
return NotImplemented
+ __hash__ = None # Silence Py3k warning
c1 = C(1)
c2 = C(2)
@@ -2755,6 +2757,7 @@ order (MRO) for bases """
return abs(self - other) <= 1e-6
except:
return NotImplemented
+ __hash__ = None # Silence Py3k warning
zz = ZZ(1.0000003)
self.assertEqual(zz, 1+0j)
self.assertEqual(1+0j, zz)
@@ -2767,6 +2770,7 @@ order (MRO) for bases """
self.value = int(value)
def __cmp__(self_, other):
self.fail("shouldn't call __cmp__")
+ __hash__ = None # Silence Py3k warning
def __eq__(self, other):
if isinstance(other, C):
return self.value == other.value
@@ -3262,6 +3266,7 @@ order (MRO) for bases """
class S(str):
def __eq__(self, other):
return self.lower() == other.lower()
+ __hash__ = None # Silence Py3k warning
def test_subclass_propagation(self):
# Testing propagation of slot functions to subclasses...