-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
Add advanced debugging examples to pdb documentation #119579
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
Comments
So there's a difference between a documentation and a tutorial. We need to keep a balance so that the user is not swamped reading all the details and examples.
That's it. Basically anything contradicts this would be considered a bug. It can't replace
However, it's okay if you do not want to type the commands repeatedly and put them in the |
I think this is where the misunderstanding is stemming from. I'm suggesting something which show cases the ability to start a python program with I'm suggesting this as an advanced technique, to the alternative of inserting For example I have a script located at from itertools import product
x_axis = range(6)
y_axis = range(6)
for x,y in product(x_axis, y_axis):
... Let's say I want to print the multiplication of from itertools import product
x_axis = range(6)
y_axis = range(6)
for x,y in product(x_axis, y_axis):
if x == y:
print(x*y) With your bug fix for issuing commands I can now do in
Without having to change the content of I find this very powerful and not clear from the docs at all. I do not find it clear that you can even use Before your bugfix, I could still sort of do this. Using
I do think this is an extremely useful and under documented feature of Perhaps not directly in |
I disagree with you here, merely by the fact that you can have a I much prefer issuing breakpoints (and now |
Like I said, it's definitely okay (and supported) to use Maybe we can add some section to elaborate the possibility to use I probably need some input from other core devs about this idea. |
Documentation
With gh-90095 being closed out by #116660, I believe a section on Advanced Usage of the
pdb
module would be beneficial. While the current documentation forpdb
does discuss the use of.pdbrc
file, it does not provide many examples of what is capable, these capabilities are mostly inferred. In fact a googling of".pdbrc python"
provides a few SO posts 1 2 asking how to set commands in.pdbrc
with no real explanation. Additionally I only find 2 real webpages 3 4 that discuss at length the use of.pdbrc
and it is mostly for defining aliases.This Advanced Usage section would demonstrate how to set breakpoints and issue commands to those breakpoints from within the
.pdbrc
file as an alternative to placing inlinebreakpoint()
andprint()
calls for debugging purposes.The text was updated successfully, but these errors were encountered: