albertz/py_better_exchook
View on GitHub ↗ ★ 47 Python
Zero-dependency Python excepthook/library that intelligently prints variables in stack traces
8 mentions on Hacker News by 1 person: 1 story, 7 comments · first 2014-06-05 · latest 2025-06-18
20082026
-
▲ 2
Show HN: Py_better_exchook: intelligently print variables in stack tracesstory by albertzeyer · 2025-06-18 · 0 comments
-
…more verbosity. For example, we often use this to add information about relevant local variables: https://github.com/albertz/py_better_exchook One solution to the problem with verbosity is when you have foldable text output. Then the stack…
comment by albertzeyer · 2025-03-10 · in Stack Traces Are Underrated -
…and use the PyCharm debugger? For unhandled exceptions, I have also my own little package: https://github.com/albertz/py_better_exchook I sometimes also wrap this like: try: # Sth which might throw whatever, # but we could still proceed…
comment by albertzeyer · 2021-04-10 · in Printstack – Python package that adds stack trace links to the print function -
If you like this, you might also like my small debugging utility, a better_exchook replacement: https://github.com/albertz/py_better_exchook Simple example: assert x == 4 When this fails, it will print the value of `x`.
comment by albertzeyer · 2021-03-30 · in Icecream: Never use print() to debug again in Python -
…ago actually, but updated all the time): better_exchook: https://pypi.org/project/better-exchook/ / https://github.com/albertz/py_better_exchook It's just a single file, so you can easily copy it into your project. It's a bit more advanced…
comment by albertzeyer · 2020-11-30 · in Add variables to Python traceback -
…version: 1.20200318.213331. The date/time is taken from the latest Git commit. Via this code: https://github.com/albertz/py_better_exchook/blob/2c106820ea... If I need to break the API, or want to change the versioning scheme, I can just…
comment by albertzeyer · 2020-07-29 · in Stop Abusing Semver -
…to understand and fix the problem. I published that here: https://pypi.org/project/better_exchook/ https://github.com/albertz/py_better_exchook I also often have a SIGUSR1 handler which will print the stacktrace of all threads. This is…
comment by albertzeyer · 2020-06-02 · in Guide to Python Debugging -
I once wrote something similar: https://github.com/albertz/py_better_exchook Example: https://gist.github.com/albertz/922622 It does not dump all local vars though, only those which appear in the line where the exception happened. And not…
comment by albertzeyer · 2014-06-05 · in Getting local variable values in stack traces, in production