-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-102676: Add more convenience properties to dis.Instruction
#103969
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
Conversation
Adds start_offset, cache_offset, end_offset, baseopcode, baseopname, jump_target and oparg to dis.Instruction. Also slightly improves the disassembly output by allowing opnames to overflow into the space reserved for opargs.
9a68a3c
to
2023a5e
Compare
Thanks, I will look at this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fantastic! I would just like to tweak some of the doc text, and I am wondering if the "excess opname" logic can be simplified.
Misc/NEWS.d/next/Library/2023-04-28-09-31-21.gh-issue-102676.J8qDRa.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Thanks for the detailed review! I fixed the issues with the docs/docstrings and simplified the formatting logic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! I will land this now.
Closes #102676
Adds
start_offset
,cache_offset
,end_offset
,baseopcode
,baseopname
,jump_target
andoparg
todis.Instruction
.As suggested, the disassembly output is also improved by allowing the opname
to overflow into oparg's space which reduces the number of misaligned opargs.
dis.Instruction
more useful #102676