On 17 March 2017 at 11:47, Paul Moore <p.f.mo...@gmail.com> wrote:

> On 17 March 2017 at 14:40, Nick Coghlan <ncogh...@gmail.com> wrote:
> > [...] whichever
> > version of "foo" is first on sys.path will "win", and you won't be able
> to
> > import from the other one (so you'll be able to import "foo.bar" or
> > "foo.baz", but not both). [...]
>
> Really? OK, I feel stupid now, I've been making a fuss over something
> that's actually not possible. I should have tested this. My apologies
> (in my defense, I could have sworn I remembered someone else making
> precisely this point sometime in the past, but I guess I'll have to
> put that down to advancing age and brain decay...)
>

Well, as Nick mentioned, if the `foo` Python package is a namespace package
in both foo 1.0 and foo 2.0 distributions, then, yes, both `bar` and `baz`
would be importable, and this is a case that should be documented somewhere.

So, your point is not without merit.

However, most projects with namespace packages tend to be careful with the
mapping between packages and dists as the namespace package itself then
becomes a shared space that should be populated carefully, so such an issue
should be exceedingly rare.
_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to