Skip to content
Closed
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
Update duplicate copies of pdb documentation with new prefix explanation
  • Loading branch information
SnoopJ committed May 8, 2023
commit 38a1c75e5449937959196c97dc5055ee9a5cdb0e
12 changes: 8 additions & 4 deletions Lib/pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1638,13 +1638,17 @@ def do_help(self, arg):
do_h = do_help

def help_exec(self):
"""(!) statement
"""(!)statement

Execute the (one-line) statement in the context of the current
stack frame. The exclamation point can be omitted unless the
first word of the statement resembles a debugger command. To
assign to a global variable you must always prefix the command
with a 'global' command, e.g.:
first word of the statement resembles a debugger command, e.g.:
(Pdb) !next(some_iterator)
42
(Pdb)

To assign to a global variable you must always prefix the command with
a 'global' command, e.g.:
(Pdb) global list_options; list_options = ['-l']
(Pdb)
"""
Expand Down
18 changes: 11 additions & 7 deletions Lib/pydoc_data/topics.py
Original file line number Diff line number Diff line change
Expand Up @@ -5277,19 +5277,23 @@
'\n'
' Delete the specified alias *name*.\n'
'\n'
'! statement\n'
'!statement\n'
'\n'
' Execute the (one-line) *statement* in the context of the '
'current\n'
' stack frame. The exclamation point can be omitted unless the '
'first\n'
' word of the statement resembles a debugger command. To set '
'a\n'
' global variable, you can prefix the assignment command with '
'a\n'
' "global" statement on the same line, e.g.:\n'
' word of the statement resembles a debugger command, e.g.:'
'\n'
' (Pdb) !next(some_iterator)\n'
' 42\n'
' (Pdb)\n'
'\n'
'To set a global variable, you can prefix the assignment command '
'with \n'
'a "global" statement on the same line, e.g.:\n'
'\n'
" (Pdb) global list_options; list_options = ['-l']\n"
' (Pdb) global list_options; list_options = ['-l']\n'
' (Pdb)\n'
'\n'
'run [args ...]\n'
Expand Down