Print traceback without an exception
Hello, in CPython, there is a way to print a traceback outside of an exception, through traceback.print_stack() function. What would it take to add similar functionality to micropython?
Add way to print exception traceback
@dhylands mentioned recently that it's not possible to print exception traceback. So, let's add that. In CPython, it is handled by https://docs.python.org/3/library/traceback.html module, but it would be too heavy to add whole new module for such a trivial task, so let's implement it more lightweight, and allow traceback module be implemented in terms of it.
Then, there're 2 ways to do that: 1) add method to exception object; 2) add function to some existing module which will take exception as arg. 1) is definitely more OO, but has a problem that it may be not compliant due to possible conflict with user-defined exc attribute. For 2nd option, we can add something like sys.print_exception(exc, file=sys.stdout).
Thoughts?