]> granicus.if.org Git - python/commitdiff
Issue #25382: pickletools.dis() now outputs implicit memo index for the
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 13 Oct 2015 18:20:14 +0000 (21:20 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Tue, 13 Oct 2015 18:20:14 +0000 (21:20 +0300)
MEMOIZE opcode.

Lib/pickletools.py
Misc/NEWS

index cf5df4158a0ac4fe4cd94d106e18a7d16a87ebc5..43dedb38a58b8f20460279e9ab05b9d3121f1567 100644 (file)
@@ -2440,6 +2440,7 @@ def dis(pickle, out=None, memo=None, indentlevel=4, annotate=0):
         if opcode.name in ("PUT", "BINPUT", "LONG_BINPUT", "MEMOIZE"):
             if opcode.name == "MEMOIZE":
                 memo_idx = len(memo)
+                markmsg = "(as %d)" % memo_idx
             else:
                 assert arg is not None
                 memo_idx = arg
index 142360ed87aff134e2f322f69767b5735d3eeba3..2700ad323e45bf9d17b4a51006f67585c0c872c1 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -56,6 +56,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #25382: pickletools.dis() now outputs implicit memo index for the
+  MEMOIZE opcode.
+
 - Issue #25357: Add an optional newline paramer to binascii.b2a_base64().
   base64.b64encode() uses it to avoid a memory copy.