summaryrefslogtreecommitdiffstats
path: root/Lib/dis.py
diff options
context:
space:
mode:
authorJelle Zijlstra <jelle.zijlstra@gmail.com>2024-06-20 14:07:24 (GMT)
committerGitHub <noreply@github.com>2024-06-20 14:07:24 (GMT)
commite8e151d4715839f785ff853c77594d7302b40266 (patch)
tree2e83f26c9245bd90c84eb42cd37414f40fc40fc6 /Lib/dis.py
parent55596ae0446e40f47e2a28b8897fe9530c32a19a (diff)
downloadcpython-e8e151d4715839f785ff853c77594d7302b40266.zip
cpython-e8e151d4715839f785ff853c77594d7302b40266.tar.gz
cpython-e8e151d4715839f785ff853c77594d7302b40266.tar.bz2
gh-120780: Show attribute name for LOAD_SPECIAL in dis output (#120781)
Diffstat (limited to 'Lib/dis.py')
-rw-r--r--Lib/dis.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/dis.py b/Lib/dis.py
index f5bb797..bb922b7 100644
--- a/Lib/dis.py
+++ b/Lib/dis.py
@@ -14,6 +14,7 @@ from opcode import (
_common_constants,
_intrinsic_1_descs,
_intrinsic_2_descs,
+ _special_method_names,
_specializations,
_specialized_opmap,
)
@@ -46,6 +47,7 @@ LOAD_SUPER_ATTR = opmap['LOAD_SUPER_ATTR']
CALL_INTRINSIC_1 = opmap['CALL_INTRINSIC_1']
CALL_INTRINSIC_2 = opmap['CALL_INTRINSIC_2']
LOAD_COMMON_CONSTANT = opmap['LOAD_COMMON_CONSTANT']
+LOAD_SPECIAL = opmap['LOAD_SPECIAL']
LOAD_FAST_LOAD_FAST = opmap['LOAD_FAST_LOAD_FAST']
STORE_FAST_LOAD_FAST = opmap['STORE_FAST_LOAD_FAST']
STORE_FAST_STORE_FAST = opmap['STORE_FAST_STORE_FAST']
@@ -609,6 +611,8 @@ class ArgResolver:
argrepr = obj.__name__
else:
argrepr = repr(obj)
+ elif deop == LOAD_SPECIAL:
+ argrepr = _special_method_names[arg]
return argval, argrepr
def get_instructions(x, *, first_line=None, show_caches=None, adaptive=False):