summaryrefslogtreecommitdiffstats
path: root/Lib/pickletools.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2003-01-27 22:47:53 (GMT)
committerGuido van Rossum <guido@python.org>2003-01-27 22:47:53 (GMT)
commitf29d3d6011e41b40282994375454f2020a429d79 (patch)
treee53afa499b68e0826bfa00dc93f1ca494fb8e9f4 /Lib/pickletools.py
parent99d4abf8a27fee6531a5abb76c7a6ff875f547c2 (diff)
downloadcpython-f29d3d6011e41b40282994375454f2020a429d79.zip
cpython-f29d3d6011e41b40282994375454f2020a429d79.tar.gz
cpython-f29d3d6011e41b40282994375454f2020a429d79.tar.bz2
Begin the change from 'binary vs. text mode' to 'protocol 0, 1, 2'.
The protocol now defaults to 1. Protocol 2 is still unimplemented.
Diffstat (limited to 'Lib/pickletools.py')
-rw-r--r--Lib/pickletools.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/pickletools.py b/Lib/pickletools.py
index 59e0a15..5c0367b 100644
--- a/Lib/pickletools.py
+++ b/Lib/pickletools.py
@@ -1902,7 +1902,7 @@ def dis(pickle, out=None, indentlevel=4):
_dis_test = """
>>> import pickle
>>> x = [1, 2, (3, 4), {'abc': u"def"}]
->>> pik = pickle.dumps(x)
+>>> pik = pickle.dumps(x, 0)
>>> dis(pik)
0: ( MARK
1: l LIST (MARK at 0)
@@ -1955,13 +1955,13 @@ Try again with a "binary" pickle.
Exercise the INST/OBJ/BUILD family.
>>> import random
->>> dis(pickle.dumps(random.random))
+>>> dis(pickle.dumps(random.random, 0))
0: c GLOBAL 'random random'
15: p PUT 0
18: . STOP
>>> x = [pickle.PicklingError()] * 2
->>> dis(pickle.dumps(x))
+>>> dis(pickle.dumps(x, 0))
0: ( MARK
1: l LIST (MARK at 0)
2: p PUT 0
@@ -2016,7 +2016,7 @@ True
True
>>> T[0][0] is T
True
->>> dis(pickle.dumps(L))
+>>> dis(pickle.dumps(L, 0))
0: ( MARK
1: l LIST (MARK at 0)
2: p PUT 0
@@ -2043,7 +2043,7 @@ doesn't trigger this glitch, because the disassembler realizes that
POP_MARK gets rid of the MARK. Doing a better job on the protocol 0
pickle would require the disassembler to emulate the stack.
->>> dis(pickle.dumps(T))
+>>> dis(pickle.dumps(T, 0))
0: ( MARK
1: ( MARK
2: l LIST (MARK at 1)