Hacker GitHub

← All repos

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

Mentions per year 8 mentions · busiest year 2020 (3)
20082026
  1. …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
  2. …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…
  3. 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`.
  4. …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
  5. …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
  6. …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
  7. 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…