I think there are two possible paths here: either always print a warning [not an error] when importing a module from the current directory [the first entry in sys.path] that is also available in any other entry in sys.path,
This would be GREAT!
This is a well known "gotcha" in Python -- as it happens, this happened to me just yesterday, and while I figure it out, I did waste some time on it, 'cause it was happening on the CI, which is configured differently than my development machine, and the person setting up the CI is not as familiar with Python as I am. In fact, once I'd figured it out, her response was "that seems like "gotcha" in Python" -- and indeed she's right.
So getting a warning about it would be fabulous!
Christopher Barker, PhD
Python Language Consulting
- Scientific Software Development
- Desktop GUI and Web Development
- wxPython, numpy, scipy, Cython