Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-104301: Allow leading whitespace in disambiguated pdb statements #104342

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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
Add example of disambiguated statement to pdb docs
  • Loading branch information
SnoopJ committed May 9, 2023
commit 34c84e28b595739dced6657f7d4e17b11a5a237d
14 changes: 11 additions & 3 deletions 14 Doc/library/pdb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,17 @@ can be overridden by the local file.

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 set a global variable, you can prefix the
assignment command with a :keyword:`global` statement on the same line,
e.g.::
resembles a debugger command, e.g.:

.. code-block:: none

(Pdb) ! n=42
(Pdb)

To set a global variable, you can prefix the assignment command with a
:keyword:`global` statement on the same line, e.g.:

.. code-block:: none

(Pdb) global list_options; list_options = ['-l']
(Pdb)
Expand Down
9 changes: 6 additions & 3 deletions 9 Lib/pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1642,9 +1642,12 @@ def help_exec(self):

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) ! n=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
13 changes: 8 additions & 5 deletions 13 Lib/pydoc_data/topics.py
Original file line number Diff line number Diff line change
Expand Up @@ -5283,11 +5283,14 @@
'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) ! 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)\n'
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.