[Python-Dev] Re: Proposed Python api for testing whether a module exists (original) (raw)

Paul Moore pf_moore at yahoo.co.uk
Mon Aug 2 21:35:18 CEST 2004


Jim Fulton <jim at zope.com> writes:

Phillip J. Eby wrote:

At 12:32 PM 8/2/04 -0400, Jim Fulton wrote:

I propose to add the following function to the imp module: ... Is this intended to work in the presence of import hooks? In particular, all the hooks offered by PEP 302, but also systems like 'iu', 'imputil', etc. Or, more specifically, will this be implemented in terms of the PEP 302 importer/loader protocols, or will those protocols need extending in order to allow such loaders (e.g. zipimport) to work with this new function? Paul Moore wrote: ... > Does this work in the presence of PEP 302 style import hooks? > Specifically, the case where there's a zipfile on sys.path. Good question. I was planning to implement this in terms of imp.findmodule, but that won't work in light of PEP 302. Dang. It's too bad that the imp.getloader proposed in PEP 302 isn't implemented. Paul, do you have an implementation of what would have been imp.getloader?

Sorry, no. Just did the implementation, I mainly did some of the write-up, testing, and cheerleading.

Paul.

Ooh, how Gothic. Barring the milk.



More information about the Python-Dev mailing list