[Import-SIG] PEP for the removal of PYO files

Nick Coghlan ncoghlan at gmail.com
Sat Feb 28 17:50:39 CET 2015


On 28 February 2015 at 03:06, Brett Cannon <bcannon at gmail.com> wrote:
> Here is my proposed PEP to drop .pyo files from Python. Thanks to Barry's
> work in PEP 3147 this really shouldn't have much impact on user's code (then
> again, bytecode files are basically an implementation detail so it shouldn't
> impact hardly anyone directly).

Some specific technical questions/suggestions:

* Can we make "opt-0" implied so normal pyc file names don't change at all?

* I'd like to see a description of the impact on compileall (which may
be "no impact", but I'd like the PEP to explicitly say that if so)

> One thing I would appreciate is if people have more motivation for this.
> While the maintainer of importlib in me wants to see this happen, the core
> developer in me thinks the arguments are a little weak. So if people can
> provide more reasons why this is a good thing that would be appreciated.

For that aspect, I'd suggest pitching the PEP as aiming primarily at
separating the two optimisation levels (so stripped PYO files don't
overwrite normal ones) and then simply eliminating the pyo extension
entirely as being redundant since the new mechanism will also make it
possible to distinguish optimised files from unoptimised ones.

The first is the user facing benefit of the change (e.g. it lets us
precompile all three levels in distro packages), while the latter is
just a nice import maintainer facing side-effect.

This perspective would likely be further strengthened if the "opt-0"
case were taken as the implied default rather than being explicit in
the filename.

Regards,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Import-SIG mailing list