gh-120254: Add a commands argument to pdb.set_trace#120255
gh-120254: Add a commands argument to pdb.set_trace#120255gaogaotiantian merged 10 commits intopython:mainfrom
commands argument to pdb.set_trace#120255Conversation
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.
| 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.
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.
I agree the double "those" is confusing.
There was a problem hiding this comment.
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.
| 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
| .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.
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? |
brandtbucher
left a comment
There was a problem hiding this comment.
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.Pdbcommands argument to pdb.set_trace
|
I'll just merge this then! |
commandsargument topdb.set_traceso the user can feed commands from source code #120254📚 Documentation preview 📚: https://cpython-previews--120255.org.readthedocs.build/