Martin Panter added the comment:

The only time I see a warning would be useful is if you intended to override a 
standard module with a module of the same name in the current directory. In all 
other cases I think it would be better to either generate an ImportError if the 
module is not found, or import it from wherever it is found. So I think a 
warning would not be useful in most cases.

Having any other non-existant directory in the search path is not an error and 
there is no warning either:
$ python3 -btWall
Python 3.4.2 (default, Oct  8 2014, 14:33:30) 
[GCC 4.9.1 20140903 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path.insert(0, "/blaua")
>>> import sadface
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'sadface'
>>> import urllib
>>> # Interpreter = happy


Python tracker <>
Python-bugs-list mailing list

Reply via email to