]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-42197: Don't create `f_locals` dictionary unless we actually need it. (GH-32055)
authorMark Shannon <mark@hotpy.org>
Fri, 25 Mar 2022 12:57:50 +0000 (12:57 +0000)
committerGitHub <noreply@github.com>
Fri, 25 Mar 2022 12:57:50 +0000 (12:57 +0000)
commitd7163bb35d1ed46bde9affcd4eb267dfd0b703dd
tree50ced5b75c3e1579c4e23fd7c404ac33c53b7fc3
parentb68431fadb3150134ac6ccbf501cdfeaf4c75678
bpo-42197: Don't create `f_locals` dictionary unless we actually need it. (GH-32055)

* `PyFrame_FastToLocalsWithError` and `PyFrame_LocalsToFast` are no longer called during profile and tracing.
 (Contributed by Fabio Zadrozny)

* Make accesses to a frame's `f_locals` safe from C code, not relying on calls to `PyFrame_FastToLocals` or `PyFrame_LocalsToFast`.

* Document new `PyFrame_GetLocals` C-API function.
Doc/c-api/frame.rst
Doc/whatsnew/3.11.rst
Include/cpython/frameobject.h
Include/internal/pycore_frame.h
Misc/NEWS.d/next/Core and Builtins/2022-03-22-15-12-28.bpo-42197.SwrrFO.rst [new file with mode: 0644]
Objects/frameobject.c
Python/sysmodule.c