Re: The '.' at the head of the default sys.path

Mike McDonald (mac@trantor.harris-atd.com)
Wed, 15 Jun 1994 17:40:50 GMT

In article <199406151539.AA18095@elvis.med.Virginia.EDU>, "Steven D. Majewski" <sdm7g@elvis.med.virginia.edu> writes:
|> On Jun 15, 8:35, Mike Tibbs wrote:
|> >
|> > I second Ken's proposal.
|> >
|> > There have been times when I needed to completely replace the sys.path
|> > and it would have been nice to do it via PYTHONPATH.
|> >
|> > -- End of excerpt from Mike Tibbs <tibbs@dopey.si.com>
|>
|> I happen to usually want '.' at the head of my sys.path, but I don't
|> see that the default values make much difference one way or the other
|> since:
|> (1) It's is easy to change them to what you want at build time.
|> (2) By definition, it is a site-specific value, and no code SHOULD
|> be broken by any value.
|>
|> However: although having PYTHONPATH's value prepended to the
|> builtin-value is a convenience, it's clear that there are times
|> when what you WANT is to override the defaults completely.
|> ( especially for server scripts )
|>
|> So I propose that:
|>
|> PYTHONPATH=':/usr/local/python/lib:/usr/share/python/lib'
|>
|> and
|>
|> PYTHONPATH='/usr/local/python/lib:/usr/share/python/lib'
|>
|> be give two different interpretations. One replaces the
|> value of sys.path and the other prepends it's value to
|> sys.path.

How about a "special" directory name like SYS.PATH which substitutes in the
current sys.path? The you can say things like:

PYTHONPATH=.:SYS.PATH
or
PYTHONPATH=SYS.PATH:.
or
PYTHONPATH=/home/mac/python:SYS.PATH:/usr/local/lib/python

Mike McDonald Advanced Technology Dept.
Harris Corp.
Email: mac@trantor.harris-atd.com M.S. 16-1912
Voice: (407) 727-5060 P.O. Box 37
Fax: (407) 729-3363 Melbourne, Florida 32902