8000 pdb's interact still uses a new namespace · python/cpython@fa4172b · GitHub
[go: up one dir, main page]

Skip to content

Commit fa4172b

Browse files
committed
pdb's interact still uses a new namespace
1 parent 6ecb4b3 commit fa4172b

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Doc/library/pdb.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -584,11 +584,18 @@ can be overridden by the local file.
584584

585585
.. pdbcommand:: interact
586586

587-
Start an interactive interpreter (using the :mod:`code` module) whose global
588-
and local namespaces correspond to the global and local namespaces in the
587+
Start an interactive interpreter (using the :mod:`code` module) in a new
588+
global namespace initialised from the local and global namespaces for the
589589
current scope. Use ``exit()`` or ``quit()`` to exit the interpreter and
590590
return to the debugger.
591591

592+
.. note::
593+
594+
As ``interact`` creates a new dedicated namespace for code execution,
595+
assignments to variables will not affect the original namespaces.
596+
However, modifications to any referenced mutable objects will be reflected
597+
in the original namespaces as usual.
598+
592599
.. versionadded:: 3.2
593600

594601
.. versionchanged:: 3.13
@@ -599,11 +606,6 @@ can be overridden by the local file.
599606
:pdbcmd:`interact` directs its output to the debugger's
600607
output channel rather than :data:`sys.stderr`.
601608

602-
.. versionchanged:: 3.13
603-
The implementation of :pep:`667` means that name assignments made via the
604-
interactive console will directly affect the active scope, even when
605-
running inside a function, generator, or coroutine.
606-
607609
.. _debugger-aliases:
608610

609611
.. pdbcommand:: alias [name [command]]

0 commit comments

Comments
 (0)
0