mirror of
https://github.com/python/cpython.git
synced 2025-07-24 19:54:21 +00:00
gh-118934: Fix PyEval_GetLocals docs (PEP 667) (#119932)
PEP 667's description of the planned changes to PyEval_GetLocals was internally inconsistent when accepted, so the docs added for gh-74929 didn't match either the current behaviour or the intended behaviour once gh-118934 is fixed. This PR updates the documentation and 3.13 What's New to match the intended behaviour (once gh-118934 is fixed). It also tidies up lingering references to `f_locals` always being a dictionary (this hasn't been true since at least when custom namespace support for class statement execution was added)
This commit is contained in:
parent
e378dc15b5
commit
fd6cd621e0
3 changed files with 46 additions and 21 deletions
|
@ -1347,13 +1347,13 @@ Special read-only attributes
|
|||
``object.__getattr__`` with arguments ``obj`` and ``"f_code"``.
|
||||
|
||||
* - .. attribute:: frame.f_locals
|
||||
- The dictionary used by the frame to look up
|
||||
- The mapping used by the frame to look up
|
||||
:ref:`local variables <naming>`.
|
||||
If the frame refers to an :term:`optimized scope`,
|
||||
this may return a write-through proxy object.
|
||||
|
||||
.. versionchanged:: 3.13
|
||||
Return a proxy for functions and comprehensions.
|
||||
Return a proxy for optimized scopes.
|
||||
|
||||
* - .. attribute:: frame.f_globals
|
||||
- The dictionary used by the frame to look up
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue