PEP 3147 - new .pyc format
MRAB
python at mrabarnett.plus.com
Sat Jan 30 20:16:54 EST 2010
John Bokma wrote:
> MRAB <python at mrabarnett.plus.com> writes:
>
>> Alf P. Steinbach wrote:
>>> * John Bokma:
>>>> MRAB <python at mrabarnett.plus.com> writes:
>>>>
>>>>> The PEP has a .pyr directory for each .py file:
>>>>>
>>>>> foo.py
>>>>> foo.pyr/
>>>>> f2b30a0d.pyc # Python 2.5
>>>>> f2d10a0d.pyc # Python 2.6
>>>>> f2d10a0d.pyo # Python 2.6 -O
>>>>> f2d20a0d.pyc # Python 2.6 -U
>>>>> 0c4f0a0d.pyc # Python 3.1
>>>> wow: so much for human readable file names :-(
>>> I agree.
>>>
>>> Human readable filenames would be much better.
>>>
>> The names are the magic numbers. It's all in the PEP.
>
> Naming files using magic numbers is really beyond me. The fact that the
> above needs comments to explain what's what already shows to me that
> there's a problem with this naming scheme. What if for one reason or
> another I want to delete all pyc files for Python 2.5? Where do I look
> up the magic number?
>
True. You might also want to note that "Python 2.6 -U" appears to have a
different magic number from "Python 2.6" and "Python 2.6 -O".
I don't know whether they always change for each new version.
More information about the Python-list
mailing list