summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorŁukasz Langa <lukasz@langa.pl>2012-03-12 18:59:48 (GMT)
committerŁukasz Langa <lukasz@langa.pl>2012-03-12 18:59:48 (GMT)
commit17591c1a1d0a6ba20f3b68e2c438d9b9baabc6c9 (patch)
tree3b8f439bfc86f65cc4c79558a1d980c013f05c3a /Lib
parentf28fcff17d9f777eab52126a9c8a984cac17a9ec (diff)
parentf3078fbee2b6555f0f5b1819a231f4b7d8bdf6b5 (diff)
downloadcpython-17591c1a1d0a6ba20f3b68e2c438d9b9baabc6c9.zip
cpython-17591c1a1d0a6ba20f3b68e2c438d9b9baabc6c9.tar.gz
cpython-17591c1a1d0a6ba20f3b68e2c438d9b9baabc6c9.tar.bz2
Head merge.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/pickle.py8
-rw-r--r--Lib/test/pickletester.py12
2 files changed, 20 insertions, 0 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py
index 20b3646..9e65368 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -438,6 +438,14 @@ class _Pickler:
self.write(NONE)
dispatch[type(None)] = save_none
+ def save_ellipsis(self, obj):
+ self.save_global(Ellipsis, 'Ellipsis')
+ dispatch[type(Ellipsis)] = save_ellipsis
+
+ def save_notimplemented(self, obj):
+ self.save_global(NotImplemented, 'NotImplemented')
+ dispatch[type(NotImplemented)] = save_notimplemented
+
def save_bool(self, obj):
if self.proto >= 2:
self.write(obj and NEWTRUE or NEWFALSE)
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index 1a551c8..3686a62 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -743,6 +743,18 @@ class AbstractPickleTests(unittest.TestCase):
u = self.loads(s)
self.assertEqual(t, u)
+ def test_ellipsis(self):
+ for proto in protocols:
+ s = self.dumps(..., proto)
+ u = self.loads(s)
+ self.assertEqual(..., u)
+
+ def test_notimplemented(self):
+ for proto in protocols:
+ s = self.dumps(NotImplemented, proto)
+ u = self.loads(s)
+ self.assertEqual(NotImplemented, u)
+
# Tests for protocol 2
def test_proto(self):