[Python-Dev] New and Improved Import Hooks

Guido van Rossum guido@python.org
Thu, 05 Dec 2002 04:11:17 -0500


> > I would it support this kind of code:
> >
> > sys.path = L
> > L.append(...) ?
> 
> Sure -- sys.path wouldn't be a "real" list object, just one that
> behaved as one.

Note that I've seen people write

  sys.path = ...

where ... is a list they calculated (from the old sys.path, to be
sure).  E.g.

  sys.path = filter(os.path.exists, sys.path) # remove bogus path elements

I still think I'd like sys.path to be a real list of real strings (not
necessarily representing files or directories though), with a
configurable set of handlers that are given a chance to deal with each
string in turn.  (Or was this already rejected?  I admit the Zope3
sprint is taking 150% if my attention this week.)

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