At 06:26 PM 4/21/2006 +0200, Thomas Wouters wrote:

>On 4/21/06, guido.van.rossum 
><<mailto:[email protected]>[email protected]> 
>wrote:
>>The hardest part was fixing two mutual recursive imports;
>>somehow changing "import foo" into "from . import foo" where
>>foo and bar import each other AND both are imported from __init__.py 
>>caused things to break.  Bah.
>
>Hm, this is possibly a flaw in the explicit relative import mechanism.

Actually, this sounds rather like a problem that happens in Python 2.4 as well.

If you have a package 'foo' containing modules 'bar' and 'baz', and 
foo/__init__.py imports both bar and baz, then 'import foo.bar' will fail 
inside of baz.  You have to use 'from foo import bar' or it doesn't 
work.  We run into this a lot in Chandler, which tries to expose package 
APIs from the package __init__ modules.

_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to