[Import-sig] Re: (Serious?) package namespace problem (and a proposal)

Gordon McMillan gmcm@hypernet.com
Fri, 30 Jun 2000 07:51:22 -0400


M.-A. Lemburg wrote:

> Gordon McMillan wrote:
> > 
> > Just van Rossum wrote:
> > 
> > ><silly-proposal>

[ to spell relative imports differently than absolute imports - 
Just's syntax may have been silly, but the idea is not ]

> > ></silly-proposal>

> > I can see the usefulness of relative imports, and (very)
> > infrequently, use them myself. But they have quite a few
> > problems:
> >  - hiding modules / packages outside the current package
> >  - create the possibility that an app will have 2 instances of
> >  a module,
> > thus screwing up module globals (and very hard to debug)
> >  - they slow down normal imports
> > 
> > Their main feature is "ease of use", which can be pejoratively
> > cast as "programmer laziness".
> 
> No no no... the feature can be put to clever use *within*
> packages. If you always have to specify the absolute path
> to the modules, you will have a hard time moving packages
> under new umbrella packages -- something which gets done every
> now and then. Not having relative imports then causes a lot of
> breakage.

And how does anything you've said contradict (as in "No no 
no") anything I said?

It makes your life easier. It does not make your users' lives 
easier.

Or have you missed the fact that I've had to explain on c.l.py 
(at least 3 times) that various strange problems with mx 
packages stem from misunderstanding how to install them on 
the path?

When "import mxDateTime" doesn't throw an exception, 
people for some reason expect to be able to *use* 
mxDateTime.

clever-is-often-another-name-for-stupid-ly y'rs


- Gordon