gh-102676: Add more convenience properties to dis.Instruction#103969
Merged
gvanrossum merged 13 commits intopython:mainfrom Jun 11, 2023
Merged
gh-102676: Add more convenience properties to dis.Instruction#103969gvanrossum merged 13 commits intopython:mainfrom
dis.Instruction#103969gvanrossum merged 13 commits intopython:mainfrom
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
Member
|
Thanks, I will look at this! |
gvanrossum
reviewed
May 24, 2023
Member
gvanrossum
left a comment
There was a problem hiding this comment.
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>
Member
Author
|
Thanks for the detailed review! I fixed the issues with the docs/docstrings and simplified the formatting logic. |
gvanrossum
approved these changes
Jun 11, 2023
Member
gvanrossum
left a comment
There was a problem hiding this comment.
Great! I will land this now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #102676
Adds
start_offset,cache_offset,end_offset,baseopcode,baseopname,jump_targetandopargtodis.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.Instructionmore useful #102676