Relative Package Import

Thomas thomas.bugzilla at gmx.net
Thu Jul 10 08:11:46 EDT 2008


Peter Otten wrote:
> 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/

Oups, thanks for the pointer. I thought the old doc was still valid... 
(gee, there should be forward references).

Thomas



More information about the Python-list mailing list