You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add some argument checking on pdb commands so it is not ignored silently
Pitch
Currently for some pdb commands, we simply throw out provided arguments and proceed. This could confuse users. A super common case that I had (more than a few times) was this:
(Pdb) a=1
(Pdb)
Guess what it does? It lists all the arguments to the function(which was empty). The command succeeded (in a way the user would never expect) without any kind of warning.
Similar thing for step or next, which does not take any argument. gdb and some other debuggers provide a count for such commands, so people might do
(Pdb) step3
And pdb just does a step. Normally the user would expect it does something different than step, but that's not the case. Of course it has the similar issue when the user does s = "abc" - surprise! the code goes forward!
We should catch these cases (and it's pretty cheap) and let the users know it's not the correct way to use the command (or for most cases, let them know that this IS actually a command).
Uh oh!
There was an error while loading. Please reload this page.
Feature or enhancement
Add some argument checking on pdb commands so it is not ignored silently
Pitch
Currently for some pdb commands, we simply throw out provided arguments and proceed. This could confuse users. A super common case that I had (more than a few times) was this:
Guess what it does? It lists all the arguments to the function(which was empty). The command succeeded (in a way the user would never expect) without any kind of warning.
Similar thing for
step
ornext
, which does not take any argument.gdb
and some other debuggers provide a count for such commands, so people might doAnd
pdb
just does astep
. Normally the user would expect it does something different thanstep
, but that's not the case. Of course it has the similar issue when the user doess = "abc"
- surprise! the code goes forward!We should catch these cases (and it's pretty cheap) and let the users know it's not the correct way to use the command (or for most cases, let them know that this IS actually a command).
So we could have something like:
Linked PRs
The text was updated successfully, but these errors were encountered: