Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean up dis.py a bit
  • Loading branch information
brandtbucher committed Nov 8, 2021
commit f0d2056d30e25b0c94c93ad9675bc389e93972e6
6 changes: 1 addition & 5 deletions Lib/dis.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@
MAKE_FUNCTION_FLAGS = ('defaults', 'kwdefaults', 'annotations', 'closure')

LOAD_CONST = opmap['LOAD_CONST']

BINARY_OP = opmap['BINARY_OP']
BINARY_OPS = [name for _, name in _nb_ops]

del _nb_ops

def _try_compile(source, name):
"""Attempts to compile the given source, first as an expression and
Expand Down Expand Up @@ -453,7 +449,7 @@ def _get_instructions_bytes(code, varname_from_oparg=None,
argrepr = ', '.join(s for i, s in enumerate(MAKE_FUNCTION_FLAGS)
if arg & (1<<i))
elif op == BINARY_OP:
argrepr = BINARY_OPS[arg]
_, argrepr = _nb_ops[arg]
yield Instruction(opname[op], op,
arg, argval, argrepr,
offset, starts_line, is_jump_target, positions)
Expand Down