On Thu, Nov 4, 2021 at 6:37 AM Ethan Furman <et...@stoneleaf.us> wrote: > > On 11/3/21 12:21 PM, Florian Wetschoreck wrote: > > > In order to prevent confusion, I want to point out that the primary > scenario that I meant is not that the file imports > > itself but another file in the same directory with the name of a module > that is also installed in site-packages. Not > > sure if I made that clear in my original post? > > Maybe if the module-level AttributeError included the complete path/filename > of the module? It would then be much more > easily discernible that the imported "pandas" is not the correct one. >
I like this idea. It already happens with a from-import. A cursory look at Objects/moduleobject.c suggests that it'd be one more lookup in the error handling in module_getattro, pretty doable. ChrisA _______________________________________________ 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/WZQYOI6PQF77NLNB7NLW3GKRQBYWFAJN/ Code of Conduct: http://python.org/psf/codeofconduct/