Silence a couple of warnings.

This commit is contained in:
Ezio Melotti 2011-11-06 18:50:32 +02:00
parent b22c3fe5d8
commit 030aa35a1b
2 changed files with 5 additions and 2 deletions

View File

@ -132,6 +132,8 @@ def __eq__(self, other):
def __reduce__(self):
return (create_dynamic_class, self.reduce_args)
__hash__ = None
def create_dynamic_class(name, bases):
result = pickling_metaclass(name, bases, dict())
result.reduce_args = (name, bases)

View File

@ -548,8 +548,9 @@ def test_issue_12717(self):
[dcomb.get(k, 10) for k in klist]) # get()
self.assertEqual([k in cm for k in klist],
[k in dcomb for k in klist]) # __contains__()
self.assertEqual([cm.has_key(k) for k in klist],
[dcomb.has_key(k) for k in klist]) # has_key()
with test_support.check_py3k_warnings():
self.assertEqual([cm.has_key(k) for k in klist],
[dcomb.has_key(k) for k in klist]) # has_key()
class Issue7005TestCase(unittest.TestCase):
"""Test output when None is set() as a value and allow_no_value == False.