Skip to content

bpo-44964: Add a note explaining the new semantics of f_last_i in frame objects#28200

Merged
pablogsal merged 1 commit into
python:mainfrom
pablogsal:main
Sep 7, 2021
Merged

bpo-44964: Add a note explaining the new semantics of f_last_i in frame objects#28200
pablogsal merged 1 commit into
python:mainfrom
pablogsal:main

Conversation

@pablogsal
Copy link
Copy Markdown
Member

@pablogsal pablogsal commented Sep 7, 2021

@miss-islington
Copy link
Copy Markdown
Contributor

Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 7, 2021
…me objects (pythonGH-28200)

(cherry picked from commit fa2c0b8)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Sep 7, 2021
@bedevere-bot
Copy link
Copy Markdown

GH-28202 is a backport of this pull request to the 3.10 branch.

miss-islington added a commit that referenced this pull request Sep 7, 2021
…me objects (GH-28200)

(cherry picked from commit fa2c0b8)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
global variables; :attr:`f_builtins` is used for built-in (intrinsic) names;
:attr:`f_lasti` gives the precise instruction (this is an index into the
bytecode string of the code object).
:attr:`f_lasti` gives the precise instruction (it represents a wordcode index, which
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is incorrect. f_lasti is the index in the bytecode. No need to multiply by two.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in #28208

Comment thread Doc/whatsnew/3.10.rst
source_buf = PyBytes_AsString(source_bytes_object);
code = Py_CompileString(source_buf, filename, Py_file_input);

* For ``FrameObject`` objects, the ``f_lasti`` member now represents a wordcode
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you add a note to use PyFrame_GetLineNumber() instead

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in #28208

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.

5 participants