[Python-Dev] New and Improved Import Hooks
Just van Rossum
just@letterror.com
Fri, 6 Dec 2002 11:13:10 +0100
Fredrik Lundh wrote:
> the internal import architecture does things in two steps, for
> some reason. this is also reflected in the public "imp" module
> interface:
>
> http://www.python.org/doc/2.2.2/lib/module-imp.html
>
> I'm not sure how Just's patch interacts with "imp", so maybe
> this is a non-issue.
The patch doesn't yet, but that's only to keep the patch small for initial
review purposes. I have some thoughts about how it _could_ interact with imp,
but that needs more thought. The whole find/load separation is still in tact,
and is reflected in the zipimport.zipimporter object: it has a find_module() and
a load_module() method. I'm not sure if the two-step approach is a big enough
deal to keep it in a new import scheme.
Just