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-74929: PEP 667 general docs update #119201

Merged
merged 20 commits into from
May 21, 2024

Conversation

ncoghlan
Copy link
Contributor

@ncoghlan ncoghlan 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
@ncoghlan ncoghlan added docs Documentation in the Doc dir 3.13 bugs and security fixes 3.14 new features, bugs and security fixes needs backport to 3.13 bugs and security fixes labels May 20, 2024
@ncoghlan ncoghlan self-assigned this May 20, 2024
Doc/library/functions.rst Outdated Show resolved Hide resolved
@ncoghlan
Copy link
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.

@ncoghlan ncoghlan marked this pull request as ready for review May 20, 2024 10:26
Doc/whatsnew/3.13.rst Outdated Show resolved Hide resolved
Lib/code.py Outdated Show resolved Hide resolved
@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.

@jeremyhylton jeremyhylton self-requested a review May 20, 2024 18:49
Doc/library/code.rst Outdated Show resolved Hide resolved
Copy link
Contributor

@jeremyhylton jeremyhylton 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.

Doc/library/pdb.rst Outdated Show resolved Hide resolved
@ncoghlan
Copy link
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.

@ncoghlan
Copy link
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.

@ncoghlan ncoghlan enabled auto-merge (squash) May 21, 2024 03:13
@ncoghlan
Copy link
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)

@ncoghlan ncoghlan merged commit e870c85 into python:main May 21, 2024
33 checks passed
@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

bedevere-app bot commented May 21, 2024

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

@bedevere-app bedevere-app bot 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 free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes 3.14 new features, bugs and security fixes docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants