Skip to content
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

pdb history file should be different per default, not the same with main repl #124994

Open
skirpichev opened this issue Oct 5, 2024 · 3 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@skirpichev
Copy link
Member

skirpichev commented Oct 5, 2024

Feature or enhancement

Proposal:

After quitting from debug session (triggered by breakpoint()) to the main repl, I've it's history filled with a bunch of pdb-specific stuff. Usually (always?) these lines have an invalid syntax for python.

Maybe it does make sense have access to recent repl entries after starting pdb, but hardly the main repl's history should have access to pdb history. That should live in a separate file.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

@skirpichev skirpichev added type-feature A feature request or enhancement stdlib Python modules in the Lib dir labels Oct 5, 2024
@gaogaotiantian
Copy link
Member

How did you trigger the pdb? From repl? So like

>>> breakpoint()
(pdb) quit
>>> <up-arrow>

Is there a case where this is actually useful? If you are in repl, you can already do plenty of interactive things and you are probably not debugging a serious script. It's hard for me to imagine a real use case.

@skirpichev
Copy link
Member Author

So like

No. Just breakpoint() in a source code, which was run from the repl.

you are probably not debugging a serious script.

Maybe. But above scenario apparently does make sense for non-serious scripts. The breakpoint() builtin does exits for reasons, eh?

@gaogaotiantian
Copy link
Member

As far as I know, the breakpoint() builtin is not often used together with repl. If it's easily solvable, I'm definitely not against the proposal. If we can just ignore pdb history by flipping a switch, let's do it. However, if it's not a trivial task, we probably need to think about the benefit here. How are we going to separate history from pdb? If we do that, how about other repl-like programs? How about input()? We record history from input() now and those are rarely valid Python script. What is the cutoff here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants