diff options
author | Guido van Rossum <guido@python.org> | 2024-05-05 15:31:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-05 15:31:26 (GMT) |
commit | 9c13d9e37a194f574b8591da634bf98419786448 (patch) | |
tree | f07a1aee30fcce27fc372d7892e967e7669c6c89 /Doc/c-api | |
parent | 5a0022a1d70e4f7f781c4e8d7b43e9f5c9e2f0b4 (diff) | |
download | cpython-9c13d9e37a194f574b8591da634bf98419786448.zip cpython-9c13d9e37a194f574b8591da634bf98419786448.tar.gz cpython-9c13d9e37a194f574b8591da634bf98419786448.tar.bz2 |
gh-74929: Rudimentary docs for PEP 667 (#118581)
This is *not* sufficient for the final 3.13 release, but it will do for beta 1:
- What's new entry
- Updated changelog entry (news blurb)
- Mention the proxy for f_globals in the datamodel and Python frame object docs
This doesn't have any C API details (what's new refers to the PEP).
Diffstat (limited to 'Doc/c-api')
-rw-r--r-- | Doc/c-api/frame.rst | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Doc/c-api/frame.rst b/Doc/c-api/frame.rst index 6bb1e9b..82e0980 100644 --- a/Doc/c-api/frame.rst +++ b/Doc/c-api/frame.rst @@ -120,12 +120,19 @@ See also :ref:`Reflection <reflection>`. .. c:function:: PyObject* PyFrame_GetLocals(PyFrameObject *frame) - Get the *frame*'s :attr:`~frame.f_locals` attribute (:class:`dict`). + Get the *frame*'s :attr:`~frame.f_locals` attribute. + If the frame refers to a function or comprehension, this returns + a write-through proxy object that allows modifying the locals. + In all other cases (classes, modules) it returns the :class:`dict` + representing the frame locals directly. Return a :term:`strong reference`. .. versionadded:: 3.11 + .. versionchanged:: 3.13 + Return a proxy object for functions and comprehensions. + .. c:function:: int PyFrame_GetLineNumber(PyFrameObject *frame) |