summaryrefslogtreecommitdiffstats
path: root/Lib/dis.py
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2012-06-07 18:28:14 (GMT)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2012-06-07 18:28:14 (GMT)
commit74482201b8bfe76280fbc62c1b7eaa90120415e1 (patch)
treeeed8a2c5075c802f3448354efcb89f409a62a9c9 /Lib/dis.py
parent7bda265662769ddffa8c08298ed11670e737ed46 (diff)
downloadcpython-74482201b8bfe76280fbc62c1b7eaa90120415e1.zip
cpython-74482201b8bfe76280fbc62c1b7eaa90120415e1.tar.gz
cpython-74482201b8bfe76280fbc62c1b7eaa90120415e1.tar.bz2
Issue #11823: disassembly now shows argument counts on calls with keyword args
Diffstat (limited to 'Lib/dis.py')
-rw-r--r--Lib/dis.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/dis.py b/Lib/dis.py
index f64bae6..543fdc7 100644
--- a/Lib/dis.py
+++ b/Lib/dis.py
@@ -190,6 +190,9 @@ def disassemble(co, lasti=-1):
if free is None:
free = co.co_cellvars + co.co_freevars
print('(' + free[oparg] + ')', end=' ')
+ elif op in hasnargs:
+ print('(%d positional, %d keyword pair)'
+ % (code[i-2], code[i-1]), end=' ')
print()
def _disassemble_bytes(code, lasti=-1, varnames=None, names=None,
@@ -229,6 +232,9 @@ def _disassemble_bytes(code, lasti=-1, varnames=None, names=None,
print('(%d)' % oparg, end=' ')
elif op in hascompare:
print('(' + cmp_op[oparg] + ')', end=' ')
+ elif op in hasnargs:
+ print('(%d positional, %d keyword pair)'
+ % (code[i-2], code[i-1]), end=' ')
print()
def _disassemble_str(source):