<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 11, 2013 at 10:29 AM, Daniel Holth <span dir="ltr"><<a href="mailto:dholth@gmail.com" target="_blank">dholth@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 class="im">On Thu, Jul 11, 2013 at 9:33 AM, Paul Moore <<a href="mailto:p.f.moore@gmail.com">p.f.moore@gmail.com</a>> wrote:<br>


> On 11 July 2013 13:49, Brett Cannon <<a href="mailto:brett@python.org">brett@python.org</a>> wrote:<br>
>><br>
>> The dead-simple, extremely elegant solution (starting in Python 3.4) is to<br>
>> make pip a namespace package in the stdlib with nothing more than a<br>
>> __main__.py file that installs pip; no checking if it's installed and then<br>
>> running it, etc, just blindly install pip. Then, if you install pip as a<br>
>> regular package, it takes precedence and what's in the stdlib is completely<br>
>> ignored (this helps with any possible staleness with the stdlib's bootstrap<br>
>> script vs. what's in pip, etc.). You don't even need to change the<br>
>> __main__.py in pip as it stands today since namespace packages only work if<br>
>> no regular package is found.<br>
><br>
><br>
> Wow - that is exceptionally cool. I had never realised namespace packages<br>
> would work like this.<br>
<br>
</div>Not exceptionally cool ... and that's why the namespace_package form<br>
is popular, since the first package in a set of namespace packages<br>
that gets it wrong breaks everything.<br>
</blockquote></div><br></div><div class="gmail_extra">I'm really not following that sentence. You are saying the idea is bad, but is that in general or for this specific case? And you say it's popular because people get it wrong which breaks everything?</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">And how can namespace packages be popular if they are new to Python 3.3 (the ability to execute them with -m is new in Python 3.4)? Are you talking about pkgutil's extend_path hack because I'm talking about NamespaceLoader in importlib?</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">I'm just not seeing the downside. We control the stdlib and pip, so we know the expected interaction and we are purposefully using the override mechanics so it's not going to get messed up by us if we consciously use it (and obviously have tests for it).</div>

</div>