Skip to content

Commit dbc517c

Browse files
Issue #25382: pickletools.dis() now outputs implicit memo index for the
MEMOIZE opcode.
1 parent ca77aef commit dbc517c

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

Lib/pickletools.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2440,6 +2440,7 @@ def dis(pickle, out=None, memo=None, indentlevel=4, annotate=0):
24402440
if opcode.name in ("PUT", "BINPUT", "LONG_BINPUT", "MEMOIZE"):
24412441
if opcode.name == "MEMOIZE":
24422442
memo_idx = len(memo)
2443+
markmsg = "(as %d)" % memo_idx
24432444
else:
24442445
assert arg is not None
24452446
memo_idx = arg

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ Core and Builtins
5656
Library
5757
-------
5858

59+
- Issue #25382: pickletools.dis() now outputs implicit memo index for the
60+
MEMOIZE opcode.
61+
5962
- Issue #25357: Add an optional newline paramer to binascii.b2a_base64().
6063
base64.b64encode() uses it to avoid a memory copy.
6164

0 commit comments

Comments
 (0)