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
It looks like PDB evolved the ability to handle multi-line Python expressions in Python 3.13. I didn't see this mentioned in the release notes, but I'm excited to see this feature. Thank you to whoever added this feature! (@gaogaotiantian maybe?)
I did notice that the Tab key works in a somewhat unexpected way.
When I hit Enter at the end of an if True: line, I see:
Then if I hit the Tab key I see this:
Note that a tab character is inserted (just as one would be within the old Python REPL) but the tab width looks like 2 spaces.
I expected to see this instead:
In the old Python REPL, the Tab key used to insert a tab character, but it looked like 4 spaces were inserted because the tab stop happened to be 4 characters from the end of the >>> prompt (which is 4 characters long):
One way to resolve this would be to shorten the PDB prompt to something like (P) or PDB .
I would propose instead that the Tab key should insert 4 spaces in PDB (just as the new REPL does).
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Activity
savannahostrowski commentedon Oct 12, 2024
@gaogaotiantian for input
gh-125377: Improve tab indentation for pdb multi-line input (#130471)
gaogaotiantian commentedon Mar 4, 2025
Thanks for raising this up. This is implemented in #130471 .