[Distutils] Cache PYTHONPATH? (Re: make unzipped eggs be the default)

P.J. Eby pje at telecommunity.com
Wed Jul 29 04:40:33 CEST 2009


At 09:22 PM 7/28/2009 -0500, Ian Bicking wrote:
>I can see how this could go quite wrong, but maybe if installers 
>touch some file in the library directory anytime a package is 
>installed/reinstalled/removed/etc,

You mean, like, the mtime of the directory itself?  ;-)

Really, there's no need for a file.  It seems really, really unlikely 
that there's any common filesystem where reading a file containing 
the (maybe out-of-date) contents of a directory is faster than just 
reading the directory itself.  And, courtesy of the time machine, 
there's even a 'dircache' module already in the stdlib.

i.e. if you use dircache.listdir() in place of regular listdir, 
you'll only have to read the directory once.

(Another way to do this, of course, would be to have importlib 
importer objects use the same logic to keep a cache of their target directory.)



More information about the Distutils-SIG mailing list