[Python-Dev] Relative Package Imports

Jim Fulton jim@digicool.com
Mon, 13 Sep 1999 09:35:21 -0400


Guido van Rossum wrote:
> 
> [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.

I wasn't refering to file path location either, but to 
package name-space location.  See the example I just
posted in reply to Tim.

Jim

--
Jim Fulton           mailto:jim@digicool.com   Python Powered!        
Technical Director   (888) 344-4332            http://www.python.org  
Digital Creations    http://www.digicool.com   http://www.zope.org    

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.