summaryrefslogtreecommitdiff
path: root/Lib/dis.py
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2012-06-07 14:28:14 -0400
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2012-06-07 14:28:14 -0400
commit74482201b8bfe76280fbc62c1b7eaa90120415e1 (patch)
treeeed8a2c5075c802f3448354efcb89f409a62a9c9 /Lib/dis.py
parent7bda265662769ddffa8c08298ed11670e737ed46 (diff)
downloadcpython-git-74482201b8bfe76280fbc62c1b7eaa90120415e1.tar.gz
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 f64bae66fb..543fdc7ed0 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):