cpython icon indicating copy to clipboard operation
cpython copied to clipboard

gh-74929: PEP 667 general docs update

Open ncoghlan opened this issue 1 year ago • 3 comments

  • 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: gh-74929

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

ncoghlan avatar May 20 '24 06:05 ncoghlan

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 avatar May 20 '24 06:05 ncoghlan

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 avatar May 20 '24 17:05 terryjreedy

I did not see any grammar or spelling issues.

terryjreedy avatar May 20 '24 17:05 terryjreedy

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 avatar May 21 '24 02:05 ncoghlan

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 avatar May 21 '24 02:05 ncoghlan

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 avatar May 21 '24 03:05 ncoghlan

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

miss-islington-app[bot] avatar May 21 '24 03:05 miss-islington-app[bot]

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

bedevere-app[bot] avatar May 21 '24 03:05 bedevere-app[bot]