[Python-Dev] PEP 302 and __path__

Just van Rossum just@letterror.com
Sat, 28 Dec 2002 11:24:32 +0100


Guido van Rossum wrote:

> I also would like to propose a new API to find modules:
> imp.get_loader(name[, path]). 

Hey, that's exactly what I proposed, with a better name ;-)

> This should return a module loader
> object, or None if the module isn't found; it should raise an
> exception only if something unexpected went wrong.  Once we have a
> module loader object, loader.load_module(name[, path]) should load
> (and return) the requested module. 

loader.load_module() doesn't need the optional path argument and is
indeed spec'ed without it in the PEP. This is symmetrical with
imp.load_module().

Just