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

M.-A. Lemburg mal@lemburg.com
Fri, 03 Dec 1999 11:03:31 +0100


Greg Stein wrote:
> 
> On Thu, 2 Dec 1999, M.-A. Lemburg wrote:
> >...
> > 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...
> 
> I'd rather see the builtin machinery move to Python, regardless of what
> system is used and/or what features are added.

In the long run that's probably the right direction, but right now
we are only talking a very small set of additional features,
which can easily be added to the existing code without too much
fuzz.

Plus it won't slow things down, which is important since
Python startup time is already an issue all by itself. The
imputil.py approach of doing (a whole bunch of) recursive Python
function calls to all kinds of importers will not speed this up,
I'm afraid. A on-disk lookup table would speed this up, but
it would also break the current logic in imputil.py, which
puts importer independence above all.

--

IMHO, we should retreat to a more centralized interface,
one which more resembles a manager rather than the agent
interface implemented in imputil.py. Add-ons can then
register themselves to say "hey, I can handle pyz-archives"
or "I know how to import .so modules" or "I provide a
search function which you can call to have me scan
my module container (directory, web-site, archive)".

The manager would take care of what to call and in which
order, plus delegate requests to add-ons which implement
the needed logic, e.g. add-ons for signature checking, unzipping
archives, file system lookup tables, etc.

It could also trace its actions and then keep an on-disk
knowledge base for what it did in the past to find certain
modules under certain conditions.

Anyway, all this is extra magic for some future version of
Python.

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