GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-74929: PEP 667 C API documentation by ncoghlan · Pull Request #119379 · python/cpython

Conversation

@ncoghlan

@ncoghlan ncoghlan commented May 22, 2024 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • Issue: Local variable assignment is broken when combined with threads + tracing + closures #74929

📚 Documentation preview 📚: https://cpython-previews--119379.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ncoghlan
pythongh-74929: PEP 667 C API documentation
67f645e
@ncoghlan ncoghlan added docs Documentation in the Doc dir skip news 3.13 only security fixes 3.14 bugs and security fixes needs backport to 3.13 only security fixes labels May 22, 2024
@ncoghlan ncoghlan self-assigned this May 22, 2024
@ncoghlan
ncoghlan requested review from ericsnowcurrently, gvanrossum and markshannon as code owners May 22, 2024 06:36
@bedevere-app bedevere-app Bot added the awaiting core review label May 22, 2024
@bedevere-app bedevere-app Bot mentioned this pull request May 22, 2024
Local variable assignment is broken when combined with threads + tracing + closures #74929
Closed
@ncoghlan

ncoghlan commented May 22, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Searching for the C APIs updated by the PEP identified some outdated mentions in comments, hence the changes to a few Python and C files.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ncoghlan
ncoghlan commented May 22, 2024
View reviewed changes
Comment thread Objects/frameobject.c
// with the initial value set when the frame was created...
// (unlikely) ...or it was set to some initial value by
// an earlier call to PyFrame_LocalsToFast().
// (unlikely) ...or it was set via the f_locals proxy.

@ncoghlan ncoghlan May 22, 2024

Copy link
Copy Markdown
Contributor Author

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.

I'm pretty sure this "set externally" loophole still exists, it's just accessed slightly differently now.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
ncoghlan
ncoghlan commented May 25, 2024
View reviewed changes
Comment thread Doc/whatsnew/3.13.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

ncoghlan added 3 commits May 25, 2024 15:16
@ncoghlan
Update Doc/whatsnew/3.13.rst
60917a5
@ncoghlan
Merge branch 'main' into pythongh-74929-pep-667-c-api-docs
fa3f14a
@ncoghlan
Fix incorrect reference to glossary term
560229e
@ncoghlan

ncoghlan commented May 27, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

I've kept the reference out to the PEP for details of the C API changes, so I'll submit a PR there that skips listing PyFrame_GetLocals() as a new API (it was already added back in Python 3.11, so it isn't being added by the PEP anymore)

PR posted: python/peps#3793

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ncoghlan ncoghlan mentioned this pull request May 27, 2024
PEP 667: PyFrame_GetLocals is no longer new python/peps#3793
Merged
encukou
encukou reviewed May 30, 2024
View reviewed changes
Comment thread Doc/c-api/reflection.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@ncoghlan
Fix locals/globals equivalence
b827c7e
@ncoghlan

ncoghlan commented May 30, 2024

Copy link
Copy Markdown
Contributor Author

I'll leave this another couple of days to give @markshannon and @gaogaotiantian a further chance to comment, but I'll make sure this and the related PR to the PEP are merged before beta2 next week.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

picnixz
picnixz reviewed May 30, 2024
View reviewed changes

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

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.

Small nitpicks for consistency.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/whatsnew/3.13.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/c-api/reflection.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

ncoghlan and others added 2 commits May 31, 2024 20:43
@ncoghlan @picnixz
Apply suggestions from code review
3c04ea9
Co-authored-by: Bénédikt Tran <[email protected]>
@ncoghlan
Merge branch 'main' into pythongh-74929-pep-667-c-api-docs
185b48f
@ncoghlan ncoghlan mentioned this pull request May 31, 2024
Python 3.13.0b1: exec() does not populate locals() #118888
Closed
@ncoghlan
ncoghlan merged commit 3859e09 into python:main Jun 1, 2024
@bedevere-app bedevere-app Bot removed the awaiting core review label Jun 1, 2024
@miss-islington-app

miss-islington-app Bot commented Jun 1, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 1, 2024
@ncoghlan @miss-islington
pythongh-74929: PEP 667 C API documentation (pythongh-119379)
898cd58
* Add docs for new APIs
* Add soft-deprecation notices
* Add What's New porting entries
* Update comments referencing `PyFrame_LocalsToFast()` to mention the proxy instead
* Other related cleanups found when looking for refs to the deprecated APIs
(cherry picked from commit 3859e09)

Co-authored-by: Alyssa Coghlan <[email protected]>
@bedevere-app

bedevere-app Bot commented Jun 1, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Jun 1, 2024
barneygale pushed a commit to barneygale/cpython that referenced this pull request Jun 5, 2024
@ncoghlan @barneygale
pythongh-74929: PEP 667 C API documentation (pythongh-119379)
5c79eb4
* Add docs for new APIs
* Add soft-deprecation notices
* Add What's New porting entries
* Update comments referencing `PyFrame_LocalsToFast()` to mention the proxy instead
* Other related cleanups found when looking for refs to the deprecated APIs
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
@ncoghlan @estyxx
pythongh-74929: PEP 667 C API documentation (pythongh-119379)
d290499
* Add docs for new APIs
* Add soft-deprecation notices
* Add What's New porting entries
* Update comments referencing `PyFrame_LocalsToFast()` to mention the proxy instead
* Other related cleanups found when looking for refs to the deprecated APIs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@encukou encukou encukou left review comments
@picnixz picnixz picnixz left review comments
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner
@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner
@gvanrossum gvanrossum Awaiting requested review from gvanrossum

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@ncoghlan ncoghlan

Labels

3.13 only security fixes 3.14 bugs and security fixes docs Documentation in the Doc dir skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@ncoghlan @encukou @picnixz
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.