pudb
pudb copied to clipboard
PEP 553
This was accepted. It adds a breakpoint()
builtin, and a sys.breakpointhook
and PYTHONBREAKPOINT
environment variable to configure it. Obviously we should add support for it.
Python 3.7 was released with this included so it can now be tested and used.
I guess all the standard pudb entry points should set sys.breakpointhook on 3.7+. We can also add some docs on how to set PYTHONBREAKPOINT so that you can just use breakpoint()
without importing pudb.
Yeah. I'd say we also set sys.breakpointhook = pudb.set_trace
when pudb is imported.
Any volunteers to hack together the patch?
I'm not a fan of imports without any function calls changing behavior like that (magic imports like pudb.b notwithstanding). Though I don't know if anyone ever imports pudb as a library.
I agree with the sentiment. In this case, my thought was to make python -m pudb
do the obviously (I guess?) correct thing when it hits breakpoint()
. It seems we only get to have one of these, and I'm leaning towards sacrificing freedom from side effects on import. You?
You can still enable it on all the entrypoints. python -m pudb
runs main()
, which isn't run with just import pudb
https://github.com/inducer/pudb/blob/master/pudb/main.py#L31
Fair. Just doing it in main()
would be sufficient IMO then.
Thanks for your work on this project - it has been my favorite debugger for years.
As it is now, it doesn't seem like there's a way to set parameters - in a remote debugging case for example
from pudb.remote import set_trace; set_trace(term_size=(80, 24))
trying to set PYTHONBREAKPOINT=pudb.remote.set_trace
works sometimes, but in docker for example the default settings result in a blacked out screen
Is there a separate mechanism to set the parameters either with an intermediate class constructor or separate env variables, like https://pypi.org/project/remote-pdb/ ?
in docker for example the default settings result in a blacked out screen
We should see about getting that fixed. Could you file a bug?
Is there a separate mechanism to set the parameters either with an intermediate class constructor or separate env variables, like https://pypi.org/project/remote-pdb/ ?
Not currently, but a PR could change that. :)
Don't know if there's anything left to do here. breakpoint() and PYTHONPBREAKPOINT are documented, and setting sys.breakpoint automatically seemed like a bad idea.