(Serious?) package namespace problem (and a proposal)

Gordon McMillan gmcm at hypernet.com
Thu Jun 29 13:08:36 EDT 2000


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". 

not-that-I'd-ever-say-such-a-thing-ly y'rs

- Gordon



More information about the Python-list mailing list