Cacheing sys.path rather than building it each time?

Hamish Lawson hamish_lawson at yahoo.co.uk
Sat Apr 8 10:28:15 EDT 2000


Steve Holden wrote:

> Probably not an awfully good idea, given that "installation" of
> a new module often consists of just dropping a ".py" file into
> a library directory.  Without an common "install" process the
> work of checking whether the cahced path is up to date would
> be almost as much as that of building the path from scratch
> as is now done.

Had you thought I was proposing that such a check be done
whenever Python was started? I'd agree that the work of checking
whether the cached path is up to date would be almost as much
work as building the path. However that wasn't part of my
proposal.

Instead when a module is installed, the pathbuilder tool would be
run either by the module's install program (perhaps via the
distutils) or manually by the user. (You could even run it at
scheduled intervals if you thought that necessary to catch
omissions.) My goal is to avoid having the path built every time
Python starts.

A command-line option for the Python interpreter could be used to
determine whether it uses the cached path or builds the path from
scratch; the decision as to which should be the default I'll
leave to others.

Hamish


* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!




More information about the Python-list mailing list