summaryrefslogtreecommitdiffstats
path: root/Lib/pickletools.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2003-01-28 15:09:10 (GMT)
committerGuido van Rossum <guido@python.org>2003-01-28 15:09:10 (GMT)
commit570283584af6a9aff47d2341d6154055572aaff5 (patch)
treeecebba7ae3a90c786306bed5836a8a67e1ba21e0 /Lib/pickletools.py
parentcbe2dbddda7bbcf2f27ba668b86b21596c900edf (diff)
downloadcpython-570283584af6a9aff47d2341d6154055572aaff5.zip
cpython-570283584af6a9aff47d2341d6154055572aaff5.tar.gz
cpython-570283584af6a9aff47d2341d6154055572aaff5.tar.bz2
Fix one disassembly output now that empty tuples are no longer
memoized in text mode. Fixed some variable names in the disassembler doctest.
Diffstat (limited to 'Lib/pickletools.py')
-rw-r--r--Lib/pickletools.py23
1 files changed, 11 insertions, 12 deletions
diff --git a/Lib/pickletools.py b/Lib/pickletools.py
index d41bada..11afbd0 100644
--- a/Lib/pickletools.py
+++ b/Lib/pickletools.py
@@ -1902,8 +1902,8 @@ def dis(pickle, out=None, indentlevel=4):
_dis_test = """
>>> import pickle
>>> x = [1, 2, (3, 4), {'abc': u"def"}]
->>> pik = pickle.dumps(x, 0)
->>> dis(pik)
+>>> pkl = pickle.dumps(x, 0)
+>>> dis(pkl)
0: ( MARK
1: l LIST (MARK at 0)
2: p PUT 0
@@ -1930,8 +1930,8 @@ _dis_test = """
Try again with a "binary" pickle.
->>> pik = pickle.dumps(x, 1)
->>> dis(pik)
+>>> pkl = pickle.dumps(x, 1)
+>>> dis(pkl)
0: ] EMPTY_LIST
1: q BINPUT 0
3: ( MARK
@@ -1975,13 +1975,12 @@ Exercise the INST/OBJ/BUILD family.
44: p PUT 3
47: ( MARK
48: t TUPLE (MARK at 47)
- 49: p PUT 4
- 52: s SETITEM
- 53: b BUILD
- 54: a APPEND
- 55: g GET 1
- 58: a APPEND
- 59: . STOP
+ 49: s SETITEM
+ 50: b BUILD
+ 51: a APPEND
+ 52: g GET 1
+ 55: a APPEND
+ 56: . STOP
>>> dis(pickle.dumps(x, 1))
0: ] EMPTY_LIST
@@ -2071,7 +2070,7 @@ pickle would require the disassembler to emulate the stack.
14: . STOP
"""
-__test__ = {'dissassembler_test': _dis_test,
+__test__ = {'disassembler_test': _dis_test,
}
def _test():