Skip to content

Conversation

@ncoghlan
Copy link
Contributor

@ncoghlanncoghlan commented May 20, 2024

  • 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


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

* 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
@ncoghlanncoghlan added docs Documentation in the Doc dir 3.13 bugs and security fixes 3.14 bugs and security fixes needs backport to 3.13 bugs and security fixes labels May 20, 2024
@ncoghlanncoghlan self-assigned this May 20, 2024
@ncoghlan
Copy link
ContributorAuthor

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.

@ncoghlanncoghlan marked this pull request as ready for review May 20, 2024 10:26
@terryjreedy
Copy link
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

@terryjreedy
Copy link
Member

I did not see any grammar or spelling issues.

@jeremyhyltonjeremyhylton self-requested a review May 20, 2024 18:49
Copy link
Contributor

@jeremyhyltonjeremyhylton left a 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.

@ncoghlan
Copy link
ContributorAuthor

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.

@ncoghlan
Copy link
ContributorAuthor

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.

@ncoghlanncoghlan enabled auto-merge (squash) May 21, 2024 03:13
@ncoghlan
Copy link
ContributorAuthor

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) 

@ncoghlanncoghlan merged commit e870c85 into python:mainMay 21, 2024
@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 21, 2024
* 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 <ncoghlan@gmail.com>
@bedevere-app
Copy link

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

@bedevere-appbedevere-appbot removed the needs backport to 3.13 bugs and security fixes label May 21, 2024
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
* 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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.13bugs and security fixes3.14bugs and security fixesdocsDocumentation in the Doc dirskip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@ncoghlan@terryjreedy@blaisep@hugovk@jeremyhylton