Skip to content

Conversation

@gaogaotiantian
Copy link
Member

@gaogaotiantian gaogaotiantian commented Jun 8, 2024

Comment on lines 214 to 215
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Member Author

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?

Copy link
Contributor

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.

Copy link
Member

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

.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.
Copy link
Contributor

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.

@gaogaotiantian
Copy link
Member Author

I moved this argument to set_trace() where it makes more sense. Partially due to the impact of #121451 - we won't create a Pdb instance every time we try to bring up a debugger.

@gaogaotiantian
Copy link
Member Author

Hi @brandtbucher , could you take a look at this feature and see if it's reasonable to add?

Copy link
Member

@brandtbucher brandtbucher left a 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.

@gaogaotiantian
Copy link
Member Author

@brandtbucher do you think this needs a whatsnew entry?

@brandtbucher
Copy link
Member

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.

@gaogaotiantian gaogaotiantian changed the title gh-120254: Add a commands argument to pdb.Pdb gh-120254: Add a commands argument to pdb.set_trace Sep 24, 2024
@gaogaotiantian
Copy link
Member Author

I'll just merge this then!

@gaogaotiantian gaogaotiantian merged commit af8403a into python:main Sep 24, 2024
3 checks passed
@gaogaotiantian gaogaotiantian deleted the pdb-commands branch September 24, 2024 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants