Relative Package Import

Peter Otten __peter__ at web.de
Wed Jul 9 10:42:05 EDT 2008


Thomas wrote:

> Robert Hancock wrote:
>> mypackage/
>>           __init__.py
>>           push/
>>                     __init__.py
>>                      dest.py
>>          feed/
>>                    __init__py
>>                     subject.py
>> 
>> In subject.py I have
>>      from ..push import dest
> 
> There is no such thing as relative package imports. See
> http://www.python.org/doc/essays/packages.html

Unless you are using Python 1.5 the following document is a bit more
relevant:

http://www.python.org/dev/peps/pep-0328/

Peter




More information about the Python-list mailing list