Issue #6477: Merge with 3.3.

This commit is contained in:
Alexandre Vassalotti 2013-11-30 16:21:20 -08:00
commit 3c23e7a5dc
6 changed files with 58 additions and 4 deletions

View file

@ -804,6 +804,15 @@ class AbstractPickleTests(unittest.TestCase):
u = self.loads(s)
self.assertIs(NotImplemented, u)
def test_singleton_types(self):
# Issue #6477: Test that types of built-in singletons can be pickled.
singletons = [None, ..., NotImplemented]
for singleton in singletons:
for proto in protocols:
s = self.dumps(type(singleton), proto)
u = self.loads(s)
self.assertIs(type(singleton), u)
# Tests for protocol 2
def test_proto(self):