Friendly version 0.3 has been released. This version also marks the official name change from the former friendly-traceback.
Before I started working on Friendly, I assumed that to do custom exception handling, one simply had to redefine sys.excepthook. However, I since found out that this does not work in many environments, including all those based on IPython (which include Jupyter notebooks). Even Python's IDLE, at least up until Python version 3.10.0a5, does not work with a simple replacement of sys.excepthook.
Additionally, creating coloured output varies depending on the programming environment. Thankfully, this can be done in most environments simply by using Rich -- sometimes supplemented by a bit of additional code.
As a result, friendly includes various custom modules so that it can work with the following:
- IDLE (see this and the following 2 pages)
- Mu (see four pages starting here)
- Jupyter notebooks and Jupyter Lab (which also work with Google colab)
- IPython console
- VS Code (either running from the terminal or with embedded notebooks)
>>> a = math.sine(1)
Traceback (most recent call last):
File "<friendly-console:2>", line 1, in <module>
a = math.sine(1)
AttributeError: module 'math' has no attribute 'sine'
Did you mean one of the following: `sin, sinh, asin`?