[Python-Dev] PEP 3147: PYC Repository Directories

Glenn Linderman glenn at nevcal.com
Fri Feb 5 00:00:52 CET 2010

On approximately 2/4/2010 2:28 PM, came the following characters from 
the keyboard of Eric Smith:
> Glenn Linderman wrote:
>> On approximately 1/30/2010 4:00 PM, came the following characters 
>> from the keyboard of Barry Warsaw:
>>> When the Python executable is given a `-R` flag, or the environment
>>> variable `$PYTHONPYR` is set, then Python will create a `foo.pyr`
>>> directory and write a `pyc` file to that directory with the hexlified
>>> magic number as the base name.
>> After the discussion so far, my opinion is that if the source 
>> directory contains an appropriate python repositiory directory [1], 
>> and the version of Python implements PEP 3147, that there should be 
>> no need for -R or $PYTHONPYR to exist, but that such versions of 
>> Python would simply, and always look in the python repository 
>> directory for binaries.
> How would the python repository directory ever get created?

When a PEP 3147 (if modified by my suggestion) version of Python runs, 
and the directory doesn't exist, and it wants to create a .pyc, it would 
create the directory, and put the .pyc there.  Sort of just like how it 
creates .pyc files, now, but an extra step of creating the repository 
directory if it doesn't exist.  After the first run, it would exist.  It 
is described in the PEP, and I quoted that section... "Python will 
create a 'foo.pyr' directory"... I'm just suggesting different semantics 
for how many directories, and what is contained in them.

“Everyone is entitled to their own opinion, but not their own facts. In 
turn, everyone is entitled to their own opinions of the facts, but not 
their own facts based on their opinions.” -- Guy Rocha, retiring NV 
state archivist

More information about the Python-Dev mailing list