3 ms·
Thanks for the release. I just upgraded and error messages are really nice. One bit I might be missing is that Python 3.10 added suggestions for AttributeError
by xtreak29 5y ago
Thanks for the release. I just upgraded and error messages are really nice. One bit I might be missing is that Python 3.10 added suggestions for AttributeError and NameError. It seems the suggestions are not stored in the exception object but calculated when Error is displayed. There is a note that that this won't work with IPython but it will be good to check if it's feasible.
https://bugs.python.org/issue38530 https://bugs.python.org/issue38530
https://docs.python.org/3/whatsnew/3.10.html#attributeerrors https://docs.python.org/3/whatsnew/3.10.html#attributeerrors
- aroberge 5y agoOne way might be to do like what IDLE does (I think) which is to essentially print the traceback to a string and extract the information. An alternative is to use https://friendly-traceback.github.io/docs/index.html https://friendly-traceback.github.io/docs/index.html which gets even more information than Python 3.10 does and is compatible with IPython/Jupyter.
- carreau 5y agoIt's probably feasible, I need to look into how the suggestion is stored and display it. You seem to have looked into it more than I, do you want to open an issue with your thoughts ? I'm also hopping to integrate with https://pypi.org/project/friendly-traceback/ https://pypi.org/project/friendly-traceback/ at some point.
- xtreak29 5y agoThanks, opened an issue for discussion : https://github.com/ipython/ipython/issues/13445 https://github.com/ipython/ipython/issues/13445