Re: strange import phenomenon

2005-09-23 Thread Christoph Zwerschke
>One idea that seems to work is setting __name__ = '__main__' Or, del sys.modules[__name__]. -- http://mail.python.org/mailman/listinfo/python-list

Re: strange import phenomenon

2005-09-22 Thread Christoph Zwerschke
Thank you, Dieter! Bingo. When I think about it now, it is very logical: There must be another mechanism besides sys.path, otherwise modules inside packages would not find their siblings or subpackages. But whereever the search path is explained, only sys.path was mentioned, so I took that at

Re: strange import phenomenon

2005-09-21 Thread Dieter Maurer
Christoph Zwerschke <[EMAIL PROTECTED]> writes on Tue, 20 Sep 2005 11:20:37 +0200: > Just hitting a strange problem with Python import behavior. It is the > same on all Python 2.x versions and it is probably correct, but I > currently don't understand why this happens. > ... > --- dir/__init__.py

strange import phenomenon

2005-09-20 Thread Christoph Zwerschke
Just hitting a strange problem with Python import behavior. It is the same on all Python 2.x versions and it is probably correct, but I currently don't understand why this happens. I have created a directory "dir" with the following three module, __init__, hello, and test2; and another module t