<p dir="ltr"><br>
On 30 Jan 2014 23:26, "Paul Moore" <<a href="mailto:p.f.moore@gmail.com">p.f.moore@gmail.com</a>> wrote:<br>
><br>
> On 30 January 2014 12:29, Nick Coghlan <<a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a>> wrote:<br>
> > I actually think this is a useful thing to experiment with, I'm just<br>
> > not sure distlib is the best place for that experiment. With<br>
> > appropriately secure tempfile handling and the right sys.path (and<br>
> > module __path__) manipulation it's not obviously *impossible* to<br>
> > handle C extensions at arbitrary positions in the module namespace<br>
> > this way, just difficult. zipimport itself is a bad place to<br>
> > experiment though, since not only is it currently a complex ball of C<br>
> > code, but adding such a feature without clear evidence of robust<br>
> > support in a third party project would be irresponsible.<br>
><br>
> I just sent a long message that essentially gave a chunk of history<br>
> and suggested a similar thing - an "enhanced zipimport" module to<br>
> experiment with solutions in this space. With importlib available, an<br>
> experimental implementation shouldn't even be too hard.<br>
><br>
> The only difference is that I see very little reason why such a<br>
> solution can't apply to all zipfiles, and not just wheels.</p>
<p dir="ltr">The advantage of wheels over plain zipfiles for this use case is the structured metadata. distlib.mount doesn't try to guess the package structure for the extensions, you have to provide an EXTENSIONS file in the metadata that explains what C extensions are present and how they should map into the module namespace.</p>

<p dir="ltr">Cheers,<br>
Nick.</p>
<p dir="ltr">> Paul<br>
</p>