[Python-Dev] New and Improved Import Hooks

Martin v. Löwis martin@v.loewis.de
Tue, 3 Dec 2002 10:31:53 +0100


> And then it still does many things that "aren't clearly needed".

Yes, but these are mostly reorganizations of stuff, eg. pieces of a
function moved into functions of their own. This is, in general, a good
thing, as it improves readability of the resulting code (not of the
patch, though).

> The complexity is inherent *because* there's no import hook mechanism
that's
> even remotely usable from C. My patch changes that.

I would expect that the complexity is inherent in "we implement our own
file system" (i.e. zipfiles). So I don't trust promises that a great new
framework will make things simpler, unless proven wrong, by seeing
actual things that become actually simpler.

> No it doesn't. It just means that a little more work is needed.

The current patch was sitting on SF for almost a year, and nobody even
looked at it. How many more years do you want to wait for somebody
finding time for "a little more work"?

> It doesn't *belong* in import.c. It's bloat.

I don't understand. import.c does the implementation of the Python
import statement, and the patch extends the semantics of the import
statement, by allowing .zip files to be on sys.path. You could argue
that the feature itself is bloat, but if the feature is desirable, I
can't see how the implementation is bloat.

> I rather meant "I prefer not to do it by myself".

I can understand that. Unfortunately, past experience tells me that
nobody will do it, then.

If more people speak in favour of rejecting the zipfile import patch, we
should probably tell Paul Moore, so that won't invest more time into
what is a doomed project.

Regards,
Martin