-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-120254: Add a commands
argument to pdb.set_trace
#120255
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Doc/library/pdb.rst
Outdated
The *commands* argument, if given, would be a list of commands to execute | ||
when the debugger starts. It has similar effects to the :file:`.pdbrc` file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The *commands* argument, if given, would be a list of commands to execute | |
when the debugger starts. It has similar effects to the :file:`.pdbrc` file. | |
The *commands* argument, if given, is a list of commands to execute | |
when the debugger starts. Those commands are executed after those | |
optionally provided by the :file:`.pdbrc` file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think two "those" is a little bit confusing here? How about These commands are executed after any commands optionally provided by the :file:.pdbrc
file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree the double "those" is confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oups, you're right! I'm sorry I didn't reply to your question 3 weeks ago btw, but yes your suggestion is way better!
@@ -0,0 +1 @@ | |||
Added ``commands`` argument to :class:`pdb.Pdb` which allows user to send debugger commands in the source file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added ``commands`` argument to :class:`pdb.Pdb` which allows user to send debugger commands in the source file. | |
Added ``commands`` argument to :class:`pdb.Pdb` which allows users to send debugger commands in the source file. |
Doc/library/pdb.rst
Outdated
@@ -211,6 +211,9 @@ access further features, you have to do this yourself: | |||
The *readrc* argument defaults to true and controls whether Pdb will load | |||
.pdbrc files from the filesystem. | |||
|
|||
The *commands* argument, if given, would be a list of commands to execute | |||
when the debugger starts. It has similar effects to the :file:`.pdbrc` file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The phrase “similar effects” is kind of vague. I am not sure how to say it more precisely. Link to the .pdbrc
documentation? Not sure.
I moved this argument to |
Hi @brandtbucher , could you take a look at this feature and see if it's reasonable to add? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your patience.
Finally got a chance to play with it... I loved finding out that breakpoint(commands=[...])
works now! I think this is a great change.
@brandtbucher do you think this needs a whatsnew entry? |
I think NEWS is probably good enough, but you can certainly add it to What's New if you feel it's something that you want to publicize more! Adding and removing stuff from that doc is pretty lightweight. |
commands
argument to pdb.Pdb
commands
argument to pdb.set_trace
I'll just merge this then! |
commands
argument topdb.set_trace
so the user can feed commands from source code #120254📚 Documentation preview 📚: https://cpython-previews--120255.org.readthedocs.build/