[Python-Dev] PEP 488: elimination of PYO files

Steven D'Aprano steve at pearwood.info
Thu Mar 12 00:03:53 CET 2015


On Wed, Mar 11, 2015 at 05:34:10PM +0000, Brett Cannon wrote:

> I have a poll going on G+ to see what people think of the various proposed
> file name formats at
> https://plus.google.com/u/0/+BrettCannon/posts/fZynLNwHWGm . Feel free to
> vote if you have an opinion.

G+ hates my browser and won't let me vote. I click on the button and 
nothing happens. I have Javascript enabled and I'm not using any ad 
blockers.

For the record, I think only the first two options 

importlib.cpython-35.opt-0.pyc
importlib.cpython-35.opt0.pyc


are sane, and I prefer the first. I'm mildly inclined to leave out the 
opt* part for default, unoptimized code. In other words, the file name 
holds two or three '.' delimited fields, plus the extension:

<module>.<interpreter>-<version>.[opt-<optimization code>].pyc

where [...] is optional and the optimization codes for CPython will be 1 
for -O and 2 for -OO. And 0 for unoptimized, if you decide that it 
should be mandatory.

Thank you for moving forward on this, I think it is a good plan.



-- 
Steve


More information about the Python-Dev mailing list