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

Skip to content

Commit 26a0f87

Browse files
committed
Document the "jump" command in pdb.__doc__, and add a version tag for "until X".
1 parent 2dfec55 commit 26a0f87

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

Doc/library/pdb.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,9 @@ by the local file.
339339
equal to that is reached. In both cases, also stop when the current frame
340340
returns.
341341

342+
.. versionchanged:: 3.2
343+
Allow giving an explicit line number.
344+
342345
.. pdbcommand:: r(eturn)
343346

344347
Continue execution until the current function returns.

Lib/pdb.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,16 @@
147147
or equal to that is reached. In both cases, also stop when
148148
the current frame returns.
149149
150+
j(ump) lineno
151+
Set the next line that will be executed. Only available in
152+
the bottom-most frame. This lets you jump back and execute
153+
code again, or jump forward to skip code that you don't want
154+
to run.
155+
156+
It should be noted that not all jumps are allowed -- for
157+
instance it is not possible to jump into the middle of a
158+
for loop or out of a finally clause.
159+
150160
r(eturn)
151161
Continue execution until the current function returns.
152162

0 commit comments

Comments
 (0)