Skip to content

GH-90916: Add helper function to dis.Instruction and use it to reduce churn in test_dis #130643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 8 additions & 0 deletions Lib/dis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
Loading
Loading