[Import-sig] fetching source (was: Long-awaited imputil comments)

Greg Stein gstein@lyra.org
Wed, 16 Feb 2000 15:13:03 -0800 (PST)


On Wed, 16 Feb 2000, Guido van Rossum wrote:
>...
> Which reminds me -- we need to introduce a standard API to retrieve
> the source for a module that's been imported (if it's available at
> all).  I can easily see how archives can be distributed containing
> both .pyc and .py files; the zip access module could easily find the
> .py file on request.

We could do something like the following:

   source = module.__importer__.get_module_source(module)


Note that we also have:

   source = importer.get_source(parent, modname, fqname)


Something along those lines...

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/