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 would be great if pdb and/or ipdb were supported via the pp debugger command (or a new debugger command that has similar behaviour). My uninformed guess is that ipdb may be more open to extension in this way, but it may be that pdb can be monkey-patched.
Right now I use this function:
installed = False
def pp(*args, **kwds):
global installed
if not installed:
prettyprinter.install_extras(include=["dataclasses"])
return prettyprinter.pprint(*args, **kwds)
Then I have to import it using the ! debugger command, then pretty print again using that command, like:
(Pdb) !from myutils import pp
(Pdb) !pp(foo)
This works fine, but it's clunky if you run the debugger more than a few times.
What I Did
Add an import pdb; pdb.set_trace() in some code
Run the code
When you see the pdb prompt, print something using the pp command (NOT the pp function above):
(Pdb) pp foo
Expect: output printed using prettyprinter.
Got: output printed using module pprint.
The text was updated successfully, but these errors were encountered:
Description
It would be great if pdb and/or ipdb were supported via the
pp
debugger command (or a new debugger command that has similar behaviour). My uninformed guess is that ipdb may be more open to extension in this way, but it may be that pdb can be monkey-patched.Right now I use this function:
Then I have to import it using the
!
debugger command, then pretty print again using that command, like:This works fine, but it's clunky if you run the debugger more than a few times.
What I Did
import pdb; pdb.set_trace()
in some codepp
command (NOT thepp
function above):Expect: output printed using prettyprinter.
Got: output printed using module pprint.
The text was updated successfully, but these errors were encountered: