Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh-74929: PEP 667 general docs update #119201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
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
Review comments
  • Loading branch information
ncoghlan committed May 21, 2024
commit d0fa5e13b19a5b41ef89e6cf97c01f316bc1b1fb
4 changes: 2 additions & 2 deletions Doc/library/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2012,8 +2012,8 @@ are always available. They are listed here in alphabetical order.

.. versionchanged:: 3.13

The semantics of calling this function without an argument have been
adjusted as described for the :func:`locals` builtin.
The result of calling this function without an argument has been
updated as described for the :func:`locals` builtin.


.. function:: zip(*iterables, strict=False)
Expand Down
12 changes: 7 additions & 5 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ Interpreter improvements:
Performance improvements are modest -- we expect to be improving this
over the next few releases.

* :pep:`667`: The :func:`locals` builtin now has defined semantics when mutating
the returned mapping. Python debuggers and similar tools may now more reliably
update local variables in optimised frames even during concurrent code
* :pep:`667`: The :func:`locals` builtin now has
:ref:`defined semantics <whatsnew313-locals-semantics>` when mutating the
returned mapping. Python debuggers and similar tools may now more reliably
update local variables in optimized frames even during concurrent code
execution.

New typing features:
Expand Down Expand Up @@ -247,12 +248,13 @@ Improved Error Messages
through ``self.X`` from any function in its body. (Contributed by Irit Katriel
in :gh:`115775`.)

.. _whatsnew313-locals-semantics:

Defined mutation semantics for ``locals()``
-------------------------------------------

Historically, the semantics for mutating the return value of :func:`locals` have
been left to individual Python implementations to define.
Historically, the expected result of mutating the return value of :func:`locals`
has 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
Expand Down