Daniel Ashbrook
Daniel Ashbrook10mo ago

pdb.post_mortem

I see in the changlogs that pdb support exists. But I can't find any docs and I'm not clear on how to invoke it. I tried
try:
<error code>
except:
_,_,tb = sys.exc_info()
pdb.post_mortem(tb)
try:
<error code>
except:
_,_,tb = sys.exc_info()
pdb.post_mortem(tb)
but I get TypeError('MarimoPdb.__init__() missing 2 required positional arguments: 'stdout' and 'stdin'')
4 Replies
Akshay
Akshay10mo ago
You can drop into pdb using pdb.set_trace() or breakpoint(). I suppose we haven't implemented pdb.post_mortem -- an oversight of ours -- but we can implement it if it's important.
Daniel Ashbrook
Daniel AshbrookOP10mo ago
It would be pretty convenient for a way to get closer to iPython's %debug magic.
Patrick K
Patrick K3mo ago
Is there an obvious place to look to add this support by any chance? %debug is one of the things I still really miss from jupyter, fwiw, and could try to take a swing at an implementation if it's somewhat straightforward
Akshay
Akshay3mo ago
Supporting pdb.post_mortem() would be great. Our PDB subclass is here: https://github.com/marimo-team/marimo/blob/main/marimo/_runtime/marimo_pdb.py
GitHub
marimo/marimo/_runtime/marimo_pdb.py at main · marimo-team/marimo
A reactive notebook for Python — run reproducible experiments, execute as a script, deploy as an app, and version with git. - marimo-team/marimo