Message231192
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
... |
|
Date |
User |
Action |
Args |
2014-11-14 22:13:09 | martin.panter | set | recipients:
+ martin.panter, brett.cannon, terry.reedy, Arfrever, r.david.murray, eric.snow |
2014-11-14 22:13:09 | martin.panter | set | messageid: <1416003189.6.0.525039345231.issue22834@psf.upfronthosting.co.za> |
2014-11-14 22:13:09 | martin.panter | link | issue22834 messages |
2014-11-14 22:13:09 | martin.panter | create | |
|