Skip to content
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

gh-100117: Fix inaccuracy in documentation of the CodeObject's co_positions field. #119364

Merged
merged 3 commits into from
May 31, 2024

Conversation

iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented May 21, 2024

Copy link
Member

@markshannon markshannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment, but not important.

Column information is 0-indexed utf-8 byte offsets on the given source
line.
position of the source code that compiled to the *i-th* code unit. A
code unit is either a bytecode instruction or a cache entry of an
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be pedantic, cache entries can span several code units, as can the instruction if the EXTENDED_ARG prefix is included.

Maybe just use "code unit" here, and explain the instruction format elsewhere (in another PR)

@iritkatriel iritkatriel enabled auto-merge (squash) May 31, 2024 16:51
@iritkatriel iritkatriel merged commit 015b1fd into python:main May 31, 2024
25 checks passed
@miss-islington-app
Copy link

Thanks @iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 31, 2024
…co_positions field. (pythonGH-119364)

(cherry picked from commit 015b1fd)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 31, 2024
…co_positions field. (pythonGH-119364)

(cherry picked from commit 015b1fd)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented May 31, 2024

GH-119869 is a backport of this pull request to the 3.13 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 31, 2024
…co_positions field. (pythonGH-119364)

(cherry picked from commit 015b1fd)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label May 31, 2024
@bedevere-app
Copy link

bedevere-app bot commented May 31, 2024

GH-119870 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label May 31, 2024
@bedevere-app
Copy link

bedevere-app bot commented May 31, 2024

GH-119871 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label May 31, 2024
iritkatriel added a commit that referenced this pull request May 31, 2024
… co_positions field. (GH-119364) (#119870)

gh-100117: Fix inaccuracy in documentation of the CodeObject's co_positions field. (GH-119364)
(cherry picked from commit 015b1fd)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
iritkatriel added a commit that referenced this pull request May 31, 2024
… co_positions field. (GH-119364) (#119869)

gh-100117: Fix inaccuracy in documentation of the CodeObject's co_positions field. (GH-119364)
(cherry picked from commit 015b1fd)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
ambv pushed a commit that referenced this pull request Sep 4, 2024
… co_positions field. (GH-119364) (#119871)

(cherry picked from commit 015b1fd)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

code.co_positions behaviour does not match documentation
2 participants