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

Just van Rossum just at letterror.com
Thu Jun 29 10:42:27 EDT 2000


Toby Dickenson wrote:
> 
> gmcm at hypernet.com (Gordon McMillan) wrote:
> 
> >I think the "relative import" feature should be shot in the head (2 posts
> >today), but unfortunately most packages rely heavily on it.
> 
> A relative import is just as useful as a relative directory: it allows
> intra-module imports, without each module needing to know where it is
> packaged.
> 
> The real problem is that relative imports and absolute imports are
> spelled the same way.

That's an interesting way of looking at it.

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

Just



More information about the Python-list mailing list