[Python-Dev] Relative Package Imports
Guido van Rossum
guido@CNRI.Reston.VA.US
Mon, 13 Sep 1999 09:09:59 -0400
[MAL]
> > > I've spent the last two hours trying to get relative package
> > > imports to work because I need them for my extension packages
> > > which will soon all move under a new top-level package name
> > > to overcome the conflicts with PIL and Zope.
[GvR]
> > I'd much rather use absolute package names for anything that's not in
> > the same directory as the current module.
[JimF]
> I'll second Marc-Andre here.
>
> A significant headache occurs when you have a package
> that has sub-packages. Sub-packages need to be able to
> reference other sub-packages within the same package without
> knowing where the containing package is installed.
You never need to know where it is installed. When I said absolute
package name I meant package name (e.g. zope.foo.bar.subpack) not
filename. As Tim has argued, the ability to change the name of the
toplevel here is a liability, not a feature.
(On reduced bandwidth here, hence not so subtle.)
--Guido van Rossum (home page: http://www.python.org/~guido/)