[Import-sig] Re: Long-awaited imputil comments

Guido van Rossum guido@python.org
Wed, 16 Feb 2000 15:52:08 -0500


> [Guido]
> > >         I'm still worried about get_code() returning the code object
> > >         (or even a module, in the case of extensions).  This means
> > >         that something like freeze might have to re-implement the
> > >         whole module searching -- first, it might want the source code
> > >         instead of the code object, and second, it might not want the
> > >         extension to be loaded at all!

[Gordon]
> If a freeze mechanism is analyzing source, then it needs 
> source, but I don't think that's necessary. Then only other 
> reason I can see for wanting source is if freeze is running with 
> one magic number, but the frozen code will run with another, 
> (to which I say "tough toenails, tootsie").

Maybe my freezer wants to store the source as well as the code
objects, so it can give decent tracebacks.

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.

--Guido van Rossum (home page: http://www.python.org/~guido/)