Absolute imports?

Roy Smith roy at panix.com
Sat Jan 8 17:48:25 EST 2011


In article <mailman.658.1294522447.6505.python-list at python.org>,
 Terry Reedy <tjreedy at udel.edu> wrote:

> 
> Import from another file in /home/roy. (since '.' is part of sys.path).
> Or put module or package of modules in Lib/site-packages.
> But why the horror of modifying sys.path? It is normal proceedure.

Not quite horror, but since I already know the absolute path to the 
file, it seems silly to change the search path just so import can use it 
to search.  Also, if I change the search path, I risk other things 
finding my module by mistake (if there's a module name collision).



More information about the Python-list mailing list