[Python-Dev] Landmark

Guido van Rossum guido@python.org
Fri, 12 May 2000 16:29:05 -0400

> [MAL]
> > > Since string.py is being depreciated, I think we should
> > > consider a new landmark (such as os.py) or maybe even a
> > > whole new strategy for finding the standard lib location.
> [GvR]
> > I don't see a need for a new strategy
> I'll argue for (a choice of) new strategy. The getpath & friends 
> code spends a whole lot of time and energy trying to reverse 
> engineer things like developer builds and strange sys-admin 
> pranks. I agree that code shouldn't die. But it creates painful 
> startup times when Python is being used for something like 
> CGI.
> How about something on the command line that says (pick 
> one or come up with another choice):
>  - PYTHONPATH is *it*
>  - use PYTHONPATH and .pth files found <here>
>  - start in <sys.prefix>/lib/python<sys.version[:3]> and add 
>  - there's a .pth file <here> with the whole list
>  - pretty much any permutation of the above elements
> The idea being to avoid a few hundred system calls when a 
> dozen or so will suffice. Default behavior should still be to 
> magically get it right.

I'm not keen on changing the meaning of PYTHONPATH, but if you're
willing and able to set an environment variable, you can set
PYTHONHOME and it will abandon the search.  If you want a command line
option for CGI, an option to set PYTHONHOME makes sense.

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