diff options
author | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2012-06-07 18:28:14 (GMT) |
---|---|---|
committer | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2012-06-07 18:28:14 (GMT) |
commit | 74482201b8bfe76280fbc62c1b7eaa90120415e1 (patch) | |
tree | eed8a2c5075c802f3448354efcb89f409a62a9c9 /Lib/dis.py | |
parent | 7bda265662769ddffa8c08298ed11670e737ed46 (diff) | |
download | cpython-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.py | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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): |