<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 18 March 2017 at 07:04, Leonardo Rochael Almeida <span dir="ltr"><<a href="mailto:leorochael@gmail.com" target="_blank">leorochael@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On 17 March 2017 at 11:47, Paul Moore <span dir="ltr"><<a href="mailto:p.f.moore@gmail.com" target="_blank">p.f.moore@gmail.com</a>></span> wrote:<br></span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="m_-404035327456986513gmail-"><span class="">On 17 March 2017 at 14:40, Nick Coghlan <<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>> wrote:<br></span>
> [...] whichever<span class=""><br>
> version of "foo" is first on sys.path will "win", and you won't be able to<br>
> import from the other one (so you'll be able to import "foo.bar" or<br></span>
> "foo.baz", but not both). [...]<br>
<br>
</span><span class="">Really? OK, I feel stupid now, I've been making a fuss over something<br>
that's actually not possible. I should have tested this. My apologies<br>
(in my defense, I could have sworn I remembered someone else making<br>
precisely this point sometime in the past, but I guess I'll have to<br>
put that down to advancing age and brain decay...)<br></span></blockquote><div><br></div><div>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.</div><div><br></div><div><div>So, your point is not without merit.</div></div></div></div></div></blockquote><div><br></div><div>If I recall correctly, it was also a problem in some of the suggestions made during the discussions leading up to the acceptance of PEP 420 namespace packages, and one of the deciding factors in ruling out the "execute all __init__.py files found in the order they're encountered on sys.path" option.<br><br>I've been caught by that before myself, where I was reasoning about a later problem based on a design variant we ended up rejecting, rather than the approach that was actually implemented.<br></div><div class="gmail_extra"><div class="gmail_quote"><br><div>Cheers,<br></div><div>Nick.<br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Nick Coghlan | <a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a> | Brisbane, Australia</div>
</div></div>