Barry Warsaw wrote:
> On Feb 03, 2010, at 11:59 AM, M.-A. Lemburg wrote:
> 
>> How about using an optionally relative cache dir setting to let
>> the user decide ?
> 
> Why do we need that level of flexibility?

It's very easy to implement (see the code I posted) and gives
you a lot of control with a single env variable.

Some use cases:

1. PYTHONCACHE=. (store the cache files in the same dir as the
                  .py file)

 This settings mimics what we've had in Python for decades. Users
 know about this Python behavior and expect it.

 It's also the only reasonable way of shipping byte-code only
 packages.

2. PYTHONCACHE=.pycache (store the cache files in a subdir of the
                         dir where the .py file is stored)

 When using lots of cache files for multiple Python versions or
 variants, .py source code directory can easily get cluttered
 with too many such files.

 Putting them into a subdir solves this problem. This would be
 useful for developers running and testing the code with different
 Python versions.

3. PYTHONCACHE=~/.python/cache (store the cache files in a user dir,
                                outside the Python source file dir)

 This allows easy removal of all cache files and prevents
 cluttering up the sys.path dirs with cache files or directories
 altogether.

 It's also handy if the source code dirs are not writable by
 the user importing them. OTOH, every user would create a copy
 of the cache files (this is what currently happens with setuptools
 eggs and is very annoying).

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Feb 07 2010)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to