Strange import bug

Colin Brown cbrown at metservice.com
Tue Nov 25 01:22:39 CET 2003


"Adeodato Simó" <asp16 at alu.ua.es> wrote in message
news:mailman.1046.1069718245.702.python-list at python.org...
...
It doesen't try to import the current directory as a module. If first
looks *inside* the current directory for a module named abc (which can
be a directory named abc with a __init__.py file inside OR an abc.py
file OR an abc.pyc compiled file). So it finds abc, which is a dir but
also a *module* because of the __init__.py file, and imports it.
...

Ahh! I see. When "import abc" produces nothing I have to do:

>>> import abc
>>> abc.abc
this is abc
>>>

Thanks, now I can get on with the original problem I had.

Colin








More information about the Python-list mailing list