Skip to content

gh-74929: PEP 667 general docs update - #119201

Merged
ncoghlan merged 20 commits into
python:mainfrom
ncoghlan:gh-74929-pep-667-general-docs-update
May 21, 2024
Merged

gh-74929: PEP 667 general docs update#119201
ncoghlan merged 20 commits into
python:mainfrom
ncoghlan:gh-74929-pep-667-general-docs-update

Conversation

@ncoghlan

@ncoghlanncoghlan commented May 20, 2024

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


📚 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
Comment threadDoc/library/functions.rst
Comment threadDoc/library/functions.rst Outdated
Comment threadDoc/library/pdb.rst
@ncoghlan

Copy link
Copy Markdown
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.

@ncoghlan
ncoghlan marked this pull request as ready for review May 20, 2024 10:26
Comment threadDoc/whatsnew/3.13.rst Outdated
Comment threadDoc/whatsnew/3.13.rst
Comment threadLib/code.py Outdated
@terryjreedy

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

Comment threadDoc/library/functions.rst Outdated
@terryjreedy

Copy link
Copy Markdown
Member

I did not see any grammar or spelling issues.

@jeremyhylton
jeremyhylton self-requested a review May 20, 2024 18:49
Comment threadDoc/library/code.rst Outdated

@jeremyhyltonjeremyhylton left a comment

Copy link
Copy Markdown
Contributor

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.

Comment threadDoc/library/pdb.rst Outdated
@ncoghlan

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment threadDoc/library/functions.rst
@ncoghlan
ncoghlan enabled auto-merge (squash) May 21, 2024 03:13
@ncoghlan

Copy link
Copy Markdown
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)

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

Copy link
Copy Markdown

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
Copy Markdown

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