-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-108463: Make expressions/statements work as expected in pdb #108464
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
Hi @iritkatriel , this is a very straighforward feature (implementation wise) and the code change is trivial. It's only about whether we should do it or not. Could you give it a review when you have some time? Thanks! |
Sorry only saw this now. Can this break anything? |
I can't think of any meaningful case that this could break. This change only affects how "cmd" parse commands - basically what characters can be considered as the command. In pdb, we expect users to use space to separate commands and args. All the supported commands only contain letters. So in real world, this will only make a difference when the user types a string that contains characters other than letters, numbers and underscores, for example, This feature basically changed the behavior when the user types such statements/expressions - it does not report "command invalid" anymore - it runs the statement/expression. |
This needs to be documented quite prominently as a new feature because it changes behaviour quite visibly. Someone might be surprised that something now executes code when it was previously a NOP. |
I think the behavior after this change actually is closer to what the current documentation claims.
This defines how I don't think anyone would be surprised if they input We also claimed in the docs that
which is exactly what this change tries to do - Why would the user expect different behavior when they do I honestly can not think of a single case where the user would feel surprised with this change, even if they are very used to the old pdb. |
I'm not disputing the value of the change. But it's a change in behaviour which needs to be documented (a versionchanged entry, a what's new in 3.13 entry). Maybe someone will be surprised by the 3.12 behaviour, or the change between 3.12 and 3.13. It should be clear from the docs that this is a deliberate change. |
Okay, I'm a bit confused about what to document, as this is more like a "bug fix" to make pdb behave like it claimed. Maybe
This is basically what this feature fixes. I'm not sure how to organize the explanation as it's doing what the docs say. Any suggestsions on the matter? |
I think something like:
And something similar in what's new in 3.13. |
This PR makes expressions like
work in pdb.