mirror of
https://github.com/python/cpython.git
synced 2025-12-09 18:48:05 +00:00
gh-120780: Show attribute name for LOAD_SPECIAL in dis output (#120781)
This commit is contained in:
parent
55596ae044
commit
e8e151d471
6 changed files with 59 additions and 7 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue