Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError/AttributeError suggestions in Python 3.10 error messages #13445

Open
tirkarthi opened this issue Jan 12, 2022 · 1 comment
Open

NameError/AttributeError suggestions in Python 3.10 error messages #13445

tirkarthi opened this issue Jan 12, 2022 · 1 comment

Comments

@tirkarthi
Copy link

@tirkarthi tirkarthi commented Jan 12, 2022

Python 3.10 added suggestions for AttributeError and NameError in the error messages. 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 see if it's feasible. Opening an issue for discussion.

https://bugs.python.org/issue38530
https://docs.python.org/3/whatsnew/3.10.html#attributeerrors

Discussion on HN : https://news.ycombinator.com/item?id=29909799

@Carreau Carreau added this to the wishlist milestone Jan 12, 2022
@Carreau
Copy link
Member

@Carreau Carreau commented Jan 12, 2022

Thanks for opening. If it's not stored in the exception then it should not be too hard to (re)-implement.

The best would be to leverage something like friendly-traceback the offers similar suggestions, or just extends the code in UltraTB.py to extend the message if it's AttributeError or NameError.

Marking as "good first issue" as it should not be too hard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants