[Python-Dev] Import Design

M.-A. Lemburg mal@lemburg.com
Wed, 24 Nov 1999 10:32:46 +0100


Before hooking on to some more PathBuiltinImporters ;-), I'd like
to spawn a thread leading in a different direction...

There has been some discussion on what we really expect of the
import mechanism to be able to do. Here's a summary of what I
think we need:

* compatibility with the existing import mechanism

* imports from library archives (e.g. .pyl or .par-files)

* a modified intra package import lookup scheme (the thingy
  which I call "walk-me-up-Scotty" patch -- see previous posts)

And for some fancy stuff:

* imports from URLs (e.g. these could be put on the path for
  automatic inclusion in the import scan or be passed explicitly
  to __import__)

* a (file based) static lookup cache to enhance lookup
  performance which is enabled via a command line switch
  (rather than being enabled per default), so that the
  user can decide whether to apply this optimization or
  not

The point I want to make is: there aren't all that many features
we are really looking for, so why not incorporate these into
the builtin importer and only *then* start thinking about
schemes for hooks, managers, etc. ?!

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