[Import-sig] Re: (Serious?) package namespace problem (and a
proposal)
M.-A. Lemburg
mal@lemburg.com
Fri, 30 Jun 2000 11:12:26 +0200
Gordon McMillan wrote:
>
> Just van Rossum wrote:
>
> ><silly-proposal>
> >If relative imports as we know them are shot in the head, an
> >alternative spelling for relative imports could be invented.
> >Eg. with a leading period:
> >
> >import .some.submodule
> ></silly-proposal>
>
> The import SIG is comatose, but not dead.
>
> 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.
BTW, you will see this happen when I publish my new mx
extension set. (I will provide a hack to ease the pain, though.)
--
Marc-Andre Lemburg
______________________________________________________________________
Business: http://www.lemburg.com/
Python Pages: http://www.lemburg.com/python/