PyWart: Import resolution order

Michael Torrie torriem at gmail.com
Fri Jan 11 12:53:40 EST 2013


On 01/10/2013 11:13 PM, Rick Johnson wrote:
> 
> Python's import resolution order is terrible.[1]
> 
> The fact that Python looks in the stdlib _first_ is not a good idea.

Whether or not the default behavior is desirable or not, sys.path is set
by default to look in the current directory first on any Python
distribution I have looked at.  As Terry says, this fact causes a lot of
problems for newbies who accidentally override standard library modules
with their own python files and chaos ensues.

If your python installation does not search the current directory first,
then you must have changed sys.path.



More information about the Python-list mailing list