a reverse traceback magic for jupyer notebooks
Project description
reverse_tb
Install
pip install reverse_tb
How to use
from reverse_tb.core import reverse_tb
def foo():
return bar()
def bar():
return baz()
def baz():
try:
qux()
except KeyError as e:
raise Exception
return qux()
def qux():
d = {}
return d['key']
foo()
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
Cell In[2], line 9, in baz()
8 try:
----> 9 qux()
10 except KeyError as e:
Cell In[2], line 16, in qux()
15 d = {}
---> 16 return d['key']
KeyError: 'key'
During handling of the above exception, another exception occurred:
Exception Traceback (most recent call last)
Cell In[3], line 1
----> 1 foo()
Cell In[2], line 2, in foo()
1 def foo():
----> 2 return bar()
Cell In[2], line 5, in bar()
4 def bar():
----> 5 return baz()
Cell In[2], line 11, in baz()
9 qux()
10 except KeyError as e:
---> 11 raise Exception
12 return qux()
Exception:
%%reverse_tb
foo()
---------------------------------------------------------------------------
KeyError Traceback (last call first)
KeyError: 'key'
Cell In[2], line 16, in qux()
15 d = {}
---> 16 return d['key']
d = {}
Cell In[2], line 9, in baz()
8 try:
----> 9 qux()
10 except KeyError as e:
During handling of the above exception, another exception occurred:
Exception Traceback (last call first)
Exception:
Cell In[2], line 11, in baz()
9 qux()
10 except KeyError as e:
---> 11 raise Exception
12 return qux()
Cell In[2], line 5, in bar()
4 def bar():
----> 5 return baz()
Cell In[2], line 2, in foo()
1 def foo():
----> 2 return bar()
Cell In[4], line 1
----> 1 foo()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
reverse_tb-0.0.2.tar.gz
(8.2 kB
view details)
Built Distribution
File details
Details for the file reverse_tb-0.0.2.tar.gz
.
File metadata
- Download URL: reverse_tb-0.0.2.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a2701a95c9539f0352ea81adefa5c874b7f0e73c9545f886deec05d52a7b249 |
|
MD5 | 77f1d8f24d37d07df5a24d5d29c08b58 |
|
BLAKE2b-256 | 3e2d2c79d117a1773deb5baf3f20c2cb10c084efa2434b757069e256b2de5fd3 |
File details
Details for the file reverse_tb-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: reverse_tb-0.0.2-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f27afa1160fe0ee5cb58862ccd2c4e6404ccb51b8841d22ea7452596d141ec2 |
|
MD5 | 8ae3fea5b8407691c0304bb09e180727 |
|
BLAKE2b-256 | e3e5fcc8ef02943bba1d7342fb31ac4c258fba68e28ad866a37a39eef7345db7 |