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 general docs update by ncoghlan · Pull Request #119201 · python/cpython

Conversation

@ncoghlan

@ncoghlan ncoghlan commented May 20, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor
  • expand on What's New entry for PEP 667 (including porting notes)
  • review (and update) all mentions of locals and f_locals in documentation
  • define "optimised scope" as a new glossary term

C API documentation updates will be added in a separate PR

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

📚 Documentation preview 📚: https://cpython-previews--119201.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 general docs update
6ecb4b3
* expand on What's New entry for PEP 667
* review (and update) all mentions of "locals" in documentation

C API documentation updates will be added in a separate PR
@ncoghlan ncoghlan added docs Documentation in the Doc dir 3.13 only security fixes 3.14 bugs and security fixes needs backport to 3.13 only security fixes labels May 20, 2024
@ncoghlan ncoghlan self-assigned this May 20, 2024
@bedevere-app bedevere-app Bot mentioned this pull request May 20, 2024
Local variable assignment is broken when combined with threads + tracing + closures #74929
Closed
@ncoghlan ncoghlan added the skip news label May 20, 2024
ncoghlan
ncoghlan commented May 20, 2024
View reviewed changes
Comment thread Doc/library/functions.rst Resolved

Uh oh!

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

ncoghlan
ncoghlan commented May 20, 2024
View reviewed changes
Comment thread Doc/library/functions.rst Resolved

Uh oh!

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

ncoghlan
ncoghlan commented May 20, 2024
View reviewed changes
Comment thread Doc/library/pdb.rst Resolved

Uh oh!

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

@ncoghlan

ncoghlan commented May 20, 2024

Copy link
Copy Markdown
Contributor Author

In addition to the inline notes in the PR, I also need to search for references to f_locals to see if any of those need changing.

All reactions

Sorry, something went wrong.

Uh oh!

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

ncoghlan added 8 commits May 20, 2024 19:13
@ncoghlan
pdb's interact still uses a new namespace
fa4172b
@ncoghlan
Cleanup Sphinx lint errors
9ba869b
@ncoghlan
Improve What's New wording
40d0a81
@ncoghlan
Define 'optimised scope' term, review f_locals
b95890d
@ncoghlan
Move What's New entry to correct section, add credits
a87f1d7
@ncoghlan
Add porting notes
6e3f1d1
@ncoghlan
Simplify locals() versionchanged notes
ebcf2d0
@ncoghlan
Merge branch 'main' into pythongh-74929-pep-667-general-docs-update
2a15a62
@ncoghlan
ncoghlan marked this pull request as ready for review May 20, 2024 10:26
@bedevere-app bedevere-app Bot added the awaiting core review label May 20, 2024
ncoghlan added 2 commits May 20, 2024 20:32
@ncoghlan
Use newly defined term in pdb docs
1e73460
@ncoghlan
Revert extraneous whitespace change
a867005
hugovk
hugovk reviewed May 20, 2024
View reviewed changes
Comment thread Doc/whatsnew/3.13.rst Resolved

Uh oh!

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

blaisep
blaisep reviewed May 20, 2024
View reviewed changes
Comment thread Doc/whatsnew/3.13.rst Resolved

Uh oh!

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

blaisep
blaisep reviewed May 20, 2024
View reviewed changes
Comment thread Lib/code.py Resolved

Uh oh!

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

@terryjreedy

terryjreedy commented May 20, 2024

Copy link
Copy Markdown
Member

Does the following refer to something other than the c-api/frame.rst changes?

C API documentation updates will be added in a separate PR

All reactions

Sorry, something went wrong.

Uh oh!

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

terryjreedy
terryjreedy reviewed May 20, 2024
View reviewed changes
Comment thread Doc/library/functions.rst Resolved

Uh oh!

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

@terryjreedy

terryjreedy commented May 20, 2024

Copy link
Copy Markdown
Member

I did not see any grammar or spelling issues.

All reactions

Sorry, something went wrong.

Uh oh!

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

@jeremyhylton
jeremyhylton self-requested a review May 20, 2024 18:49
jeremyhylton
jeremyhylton reviewed May 20, 2024
View reviewed changes
Comment thread Doc/library/code.rst Resolved

Uh oh!

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

jeremyhylton
jeremyhylton reviewed May 20, 2024
View reviewed changes

@jeremyhylton jeremyhylton left a comment

Copy link
Copy Markdown
Contributor

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 left a handful of comments. Overall looks very good, but suggest a few minor revisions for clarity.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Doc/library/pdb.rst Resolved

Uh oh!

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

ncoghlan added 2 commits May 21, 2024 11:53
@ncoghlan
Merge remote-tracking branch 'origin/main' into pythongh-74929-pep-66…
70f1db9
…7-general-docs-update
@ncoghlan
Replace the 'mapping namespace' phrase
c5cb001
@ncoghlan

ncoghlan commented May 21, 2024

Copy link
Copy Markdown
Contributor Author

Does the following refer to something other than the c-api/frame.rst changes?

There are several C API additions and updates as described in the PEP. Most of them will be covered in frame.rst, but there are a few PyEval_* changes to be covered elsewhere.

All reactions

Sorry, something went wrong.

Uh oh!

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

ncoghlan added 3 commits May 21, 2024 12:21
@ncoghlan
Review comments
d0fa5e1
@ncoghlan
Use US spelling for 'optimized'
e109eee
@ncoghlan
Clarify that most optimizations are universal
672458f
@ncoghlan

ncoghlan commented May 21, 2024

Copy link
Copy Markdown
Contributor Author

I realised that I was using the Aus/UK spelling of optimised, while the Python docs generally use US spelling (there were 300+ instances of optimized vs less than 20 uses of optimised, including the additions in this PR).

I also added an inline note to the glossary entry pointing out that most optimizations are applied to all scopes, there's just a subset that are only valid when the local and nonlocal variables names are known at compile time.

To avoid more conflicts with sprint changes, I will merge this version once CI is happy.

All reactions

Sorry, something went wrong.

Uh oh!

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

@ncoghlan
Fix code.py wording in docs, not just docstring
270dfac
ncoghlan
ncoghlan commented May 21, 2024
View reviewed changes
Comment thread Doc/library/functions.rst Resolved

Uh oh!

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

ncoghlan added 2 commits May 21, 2024 12:52
@ncoghlan
exec quirk affects classes, too
e0ba6c7
@ncoghlan
Be consistent about 'top level'
1187f62
@ncoghlan ncoghlan mentioned this pull request May 21, 2024
DOCS: Suggest always calling exec with a globals argument and no locals argument #119235
Merged
@ncoghlan
Avoid touching unrelated files
9f86cf5
@ncoghlan
ncoghlan enabled auto-merge (squash) May 21, 2024 03:13
@ncoghlan

ncoghlan commented May 21, 2024

Copy link
Copy Markdown
Contributor Author

Capturing the commit message, just in case something fails before the auto-merge lands:

* expand on What's New entry for PEP 667 (including porting notes)
* define 'optimized scope' as a glossary term
* cover comprehensions and generator expressions in locals() docs
* review all mentions of "locals" in documentation (updating if needed)
* review all mentions of "f_locals" in documentation (updating if needed)
All reactions

Sorry, something went wrong.

Uh oh!

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

@ncoghlan
ncoghlan merged commit e870c85 into python:main May 21, 2024
@miss-islington-app

miss-islington-app Bot commented May 21, 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.

@bedevere-app bedevere-app Bot removed the awaiting core review label May 21, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 21, 2024
@ncoghlan @miss-islington
pythongh-74929: PEP 667 general docs update (pythongh-119201)
c01fa1f
* expand on What's New entry for PEP 667 (including porting notes)
* define 'optimized scope' as a glossary term
* cover comprehensions and generator expressions in locals() docs
* review all mentions of "locals" in documentation (updating if needed)
* review all mentions of "f_locals" in documentation (updating if needed)
(cherry picked from commit e870c85)

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

bedevere-app Bot commented May 21, 2024

Copy link
Copy Markdown

GH-119291 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 May 21, 2024
@hugovk hugovk mentioned this pull request May 25, 2024
Python 3.13.0b1: exec() does not populate locals() #118888
Closed
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
@ncoghlan @estyxx
pythongh-74929: PEP 667 general docs update (pythongh-119201)
1288a99
* expand on What's New entry for PEP 667 (including porting notes)
* define 'optimized scope' as a glossary term
* cover comprehensions and generator expressions in locals() docs
* review all mentions of "locals" in documentation (updating if needed)
* review all mentions of "f_locals" in documentation (updating if needed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hugovk hugovk hugovk left review comments
@terryjreedy terryjreedy terryjreedy left review comments
@jeremyhylton jeremyhylton jeremyhylton left review comments
+1 more reviewer
@blaisep blaisep blaisep left review comments
Reviewers whose approvals may not affect merge requirements

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.

5 participants

@ncoghlan @terryjreedy @blaisep @hugovk @jeremyhylton
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.