ionelmc / python-tblib

Serialization library for Exceptions and Tracebacks.
BSD 2-Clause "Simplified" License
165 stars 33 forks source link

Adding _render_traceback_ for IPython #32

Open jakirkham opened 6 years ago

jakirkham commented 6 years ago

One neat idea that occurs to me is if the Traceback object implemented the _render_traceback_ method. All IPython seems to expect is a list of individual lines. This would allow custom rendering of Tracebacks in the IPython context.

ionelmc commented 6 years ago

Not sure how this would look in the notebook - do you have examples? It would illustrate why this is needed at the very least.

On Sun, Apr 1, 2018, 00:34 jakirkham notifications@github.com wrote:

One neat idea that occurs to me is if the Traceback object implemented the _rendertraceback method http://ipython.readthedocs.io/en/stable/config/integrating.html#custom-exception-tracebacks. All IPython seems to expect is a list of individual lines. This would allow custom rendering of Tracebacks in the IPython context.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ionelmc/python-tblib/issues/32, or mute the thread https://github.com/notifications/unsubscribe-auth/AAH53ZWPp5ylW7BND2J03d_KXFhQkuXbks5tj_Z8gaJpZM4TCnuM .

jakirkham commented 6 years ago

According to the docs, it is just a list of strs. Looking a little more closely, it appears to typically be the output of traceback.format_exception (at least that is true of ipyparallel). The method appears to be called when the exception is raised in the notebook.

@minrk, would know more about this than I.