Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve What's New wording
  • Loading branch information
ncoghlan committed May 20, 2024
commit 40d0a813143a4416793a6b32c869ee99000618bf
13 changes: 7 additions & 6 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -379,14 +379,15 @@ been left to individual Python implementations to define.

Through :pep:`667`, Python 3.13 standardises the historical behaviour of CPython
for most code execution scopes, but changes optimised scopes (functions,
generators, coroutines, comprehensions, generator expressions) to explicitly
return independent snapshots of the currently assigned local and nonlocal
name references.
generators, coroutines, comprehensions, and generator expressions) to explicitly
return independent snapshots of the currently assigned local variables, included
locally referenced nonlocal variables captured in closures.

To ensure debuggers and similar tools can reliably update local variables in
affected scopes, :attr:`FrameType.f_locals <frame.f_locals>` now returns a
write-through proxy to the frame's local and locally reference nonlocal
variables rather than a ``dict`` with unclear runtime semantics.
scopes affected by this change, :attr:`FrameType.f_locals <frame.f_locals>` now
returns a write-through proxy to the frame's local and locally referenced
nonlocal variables in these scopes, rather than returning an inconsistently
updated shared ``dict`` instance with undefined runtime semantics.

See :pep:`667` for more details, including related C API changes and
deprecations.
Expand Down