diff options
author | Alyssa Coghlan <ncoghlan@gmail.com> | 2024-05-21 03:32:15 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-21 03:32:15 (GMT) |
commit | e870c852c0ea96fa4e4569e9c39c7ceb80ce858d (patch) | |
tree | 1268f6cbbc811eb44df6935992ba76ff94e0ac89 /Doc/library/pdb.rst | |
parent | 538ed5e4818aa0d0aa759634e8bfa23e317434a1 (diff) | |
download | cpython-e870c852c0ea96fa4e4569e9c39c7ceb80ce858d.zip cpython-e870c852c0ea96fa4e4569e9c39c7ceb80ce858d.tar.gz cpython-e870c852c0ea96fa4e4569e9c39c7ceb80ce858d.tar.bz2 |
gh-74929: PEP 667 general docs update (gh-119201)
* expand on What's New entry for PEP 667 (including porting notes)
* define 'optimized scope' as a glossary term
* cover comprehensions and generator expressions in locals() docs
* review all mentions of "locals" in documentation (updating if needed)
* review all mentions of "f_locals" in documentation (updating if needed)
Diffstat (limited to 'Doc/library/pdb.rst')
-rw-r--r-- | Doc/library/pdb.rst | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/Doc/library/pdb.rst b/Doc/library/pdb.rst index 7a47a7d..7d67e06 100644 --- a/Doc/library/pdb.rst +++ b/Doc/library/pdb.rst @@ -123,6 +123,11 @@ The typical usage to inspect a crashed program is:: 0 (Pdb) +.. versionchanged:: 3.13 + The implementation of :pep:`667` means that name assignments made via ``pdb`` + will immediately affect the active scope, even when running inside an + :term:`optimized scope`. + The module defines the following functions; each enters the debugger in a slightly different way: @@ -579,18 +584,17 @@ can be overridden by the local file. .. pdbcommand:: interact - Start an interactive interpreter (using the :mod:`code` module) whose global - namespace contains all the (global and local) names found in the current - scope. Use ``exit()`` or ``quit()`` to exit the interpreter and return to - the debugger. + Start an interactive interpreter (using the :mod:`code` module) in a new + global namespace initialised from the local and global namespaces for the + current scope. Use ``exit()`` or ``quit()`` to exit the interpreter and + return to the debugger. .. note:: - Because interact creates a new global namespace with the current global - and local namespace for execution, assignment to variables will not - affect the original namespaces. - However, modification to the mutable objects will be reflected in the - original namespaces. + As ``interact`` creates a new dedicated namespace for code execution, + assignments to variables will not affect the original namespaces. + However, modifications to any referenced mutable objects will be reflected + in the original namespaces as usual. .. versionadded:: 3.2 |