[Python-Dev] Re: .DLL vs .PYD search order

M.-A. Lemburg mal@lemburg.com
Thu, 02 Dec 1999 16:48:40 +0100


Fredrik Lundh wrote:
> 
> Guido van Rossum <guido@CNRI.Reston.VA.US> wrote:
> > > Actually I'm so happy with the magic cookie scheme that I've
> > > advocated at various times in the past that something similar also
> > > be used for determining where builtin modules and frozen modules
> > > appear in sys.path...
> >
> > I see the magic cookies as a poor man's (but more compatible!) version
> > of a chain of importers as advocated by Greg Stein and other imputil
> > fans.  I like the idea, except that I think that the chain should be
> > manipulatable more easily than the current imputil implementation.
> 
> I know this has been asked before, but cannot recall
> any of the arguments against it: how about replacing
> Jack's magic cookies with importer objects?
> 
> (in other words, if a path item is a string, import as
> usual.  otherwise, ask the importer for a code object
> or maybe better, a module object).

Plus, for backward compatibility, make sure that str(importerobj)
returns something which resembles a non-existing directory.

Note that the builtin importer skips non-string entries
in sys.path, so the above will only be needed for existing
import hooks.

Still, I would like to rephrase my 0.02EUR which I already
posted twice... why not start to think about what these
importers would do first ? If there are only a handful of
wishes we could just add them to the builtin machinery and
be done with it...

-- 
Marc-Andre Lemburg
______________________________________________________________________
Y2000:                                                    29 days left
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/