-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
code.co_positions behaviour does not match documentation #100117
Comments
I think this is probably just a place where the docs could be improved. Are you suggesting replacing "instruction" with "code unit"? Or adding a note that inline |
We discussed this at the meeting and I think the view was that the implementation needs to change. @markshannon ? |
I don't think we can change the current behavior of emitting one tuple per code unit . The docs should reflect that behaviour. I think it is |
This shouldn't have been closed, the doc is still incorrect. |
…co_positions field.
…co_positions field. (pythonGH-119364) (cherry picked from commit 015b1fd) Co-authored-by: Irit Katriel <[email protected]>
…co_positions field. (pythonGH-119364) (cherry picked from commit 015b1fd) Co-authored-by: Irit Katriel <[email protected]>
…co_positions field. (pythonGH-119364) (cherry picked from commit 015b1fd) Co-authored-by: Irit Katriel <[email protected]>
…co_positions field. (python#119364)
…co_positions field. (python#119364)
… co_positions field. (GH-119364) (#119871) (cherry picked from commit 015b1fd) Co-authored-by: Irit Katriel <[email protected]>
The documentation of co_positions() says:
The iterator returns tuples containing the (start_line, end_line, start_column, end_column). The i-th tuple corresponds to the position of the source code that compiled to the i-th instruction.
I think this is incorrect, because the iterator returns tuples for cache entries as well:
Linked PRs
co_lines
more efficient #100447The text was updated successfully, but these errors were encountered: