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
bpo-46422: use dis.Positions
in dis.Instruction
#30716
Conversation
Thanks for the PR @sobolevn!
- The tests only seem to cover cases where the code object is missing one of the position tables. Let's add a test like
test_co_positions
which uses the new positions API. - Let's also document the new API
Lib/dis.py
Outdated
@@ -414,7 +414,7 @@ def _get_instructions_bytes(code, varname_from_oparg=None, | |||
argval = None | |||
argrepr = '' | |||
try: | |||
positions = next(co_positions) | |||
positions = Positions(*next(co_positions)) | |||
except StopIteration: | |||
positions = None |
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.
Let's simply create an empty Positions()
object here.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Thanks for the feedback! I've added docs about I have made the requested changes; please review again. |
Thanks for making the requested changes! @isidentical: please review the changes made to this pull request. |
Azure is weirdly failing 🤦🏻 Closing/Re-opening to restart. |
Thanks very much for noticing (and fixing) this @sobolevn! |
Thanks for the review! |
CC @corona10 as my mentor.
https://bugs.python.org/issue46422