Great that you point that out. I have thought of are two possible solutions to 
this:
1. Make the current error message clearer, but make sure that it's correct for 
both cases
2. Create a special case for trying to import itself.

I personally think the second option would be superior. If necessary, we could 
create an error that inherits from ImportError for this special case, but I 
think modifying the message will be enough.

This message — or something similar — could be used for when the program is 
trying to import itself:
"ImportError: partially initialized module 'tkinter' can't import itself"

Since this isn't a too uncommon mistake, changing the error message for this 
case could both help aid the learning process and make people less scared of 
tracebacks, since the error message would actually give some valuable 
information — and possibly help them solve the error.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/L7DZMXSYG4LX5WFNW5TD2HZOSE3BD2W7/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to