mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
GH-90916: Add helper function to dis.Instruction and use it to reduce churn in test_dis (GH-130643)
This commit is contained in:
parent
63b6ec31c4
commit
885c3d126f
2 changed files with 224 additions and 208 deletions
|
@ -376,6 +376,14 @@ class Instruction(_Instruction):
|
|||
entries (if any)
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
def make(
|
||||
opname, arg, argval, argrepr, offset, start_offset, starts_line,
|
||||
line_number, label=None, positions=None, cache_info=None
|
||||
):
|
||||
return Instruction(opname, _all_opmap[opname], arg, argval, argrepr, offset,
|
||||
start_offset, starts_line, line_number, label, positions, cache_info)
|
||||
|
||||
@property
|
||||
def oparg(self):
|
||||
"""Alias for Instruction.arg."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue