[Python-Dev] New and Improved Import Hooks

M.-A. Lemburg mal@lemburg.com
Thu, 05 Dec 2002 10:48:14 +0100


Just van Rossum wrote:
> Fredrik Lundh wrote:
> 
>>FWIW, I've done lots of stuff that scans sys.path directories for
>>various purposes.  It would probably be a good idea to use a string
>>subclass for the zip importer, but I don't think we need to make
>>stringness an absolute requirement.
> 
> +1
> 
>>Let's make it *really* easy to use zip archives, and reasonably easy
>>to use other custom importers.
> 
> +1

Why not leave sys.path as list of ordinary strings and add
all the extra support to the existing import mechanism via
hooks at the right places ?!

E.g. such a hook may scan sys.path for files which end
in '.zip' and then redirect the lookups into their ZIP
archive directory.

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
_______________________________________________________________________
eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,...
Python Consulting:                               http://www.egenix.com/
Python Software:                    http://www.egenix.com/files/python/