Re: PEP for the removal of PYO files

Donald Stufft <[email protected]> Fri, 27 Feb 2015 14:28:05 -0500
Newsgroups gmane.comp.python.import
Message-ID <[email protected]>
> On Feb 27, 2015, at 2:26 PM, Brett Cannon <[email protected]> wrote:
> 
> 
> 
> On Fri, Feb 27, 2015 at 1:28 PM Barry Warsaw <[email protected] <mailto:[email protected]>> wrote:
> This looks great Brett, thanks for pushing it forward.  I think it's a
> perfectly natural and consistent extension to PEP 3147.
> 
> Some comments inlined.
> 
> On Feb 27, 2015, at 05:06 PM, Brett Cannon wrote:
> 
> >Rationale
> >=========
> >
> >  - 0: ``.pyc``
> >  - 1 (``-O``): ``.pyo``
> >  - 2 (``-OO``): ``.pyo``
> 
> This is all the rationale I need. :)
> 
> >The "opt-" prefix was chosen so as to provide a visual separator
> >from the cache tag. The placement of the optimization level after
> >the cache tag was chosen to preserve lexicographic sort order of
> >bytecode file names based on module name and cache tag which will
> >not vary for a single interpreter. The "opt-" prefix was chosen over
> >"o" so as to be somewhat self-documenting. The "opt-" prefix was
> >chosen over "O" so as to not have any confusion with "0" while being
> >so close to the interpreter version number.
> 
> I get it, and the examples you include in the open questions is helpful, but I
> still don't like "opt-".  We'll no doubt bikeshed on this until Guido
> decides but looking at the examples below I'd be okay with 'O<level>'.  Did
> you consider 'opt<level>', e.g. imporlib.cpython-35.opt0.pyc ?
> 
> Nope, and I'll think about it and at least add it as a possibility.
> 
> 
> >Compatibility Considerations
> >============================
> 
> Just as PEP 3147 had to make backward compatibility concessions to .pyc files
> living outside __pycache__ (which I think is still supported, right?)
> 
> Unfortunately yes.
> 
> I think
> you'll have to do the same for traditional .pyo files, at least for Python
> 3.5.  You won't have to *write* such files, but if they exist and the
> corresponding optimization level pyc file isn't present in __pycache__, you'll
> have to load them.
> 
> It might in fact make sense to add some language to this PEP saying that in
> Python 3.6, support for old-style .pyc and .pyo files will be removed.
> 
> Ah, but you see the magic number changed in Python 3.5 for matrix multiplication, so pre-existing .pyo files won't even load, so they will have to be regenerated regardless. I will mention that in the PEP.
> _______________________________________________
> Import-SIG mailing list
> [email protected] <mailto:[email protected]>
> https://mail.python.org/mailman/listinfo/import-sig <https://mail.python.org/mailman/listinfo/import-sig>

Some people ship .pyc only code, do people also ship .pyo only code?

---
Donald Stufft
PGP: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA

_______________________________________________
Import-SIG mailing list
[email protected]
https://mail.python.org/mailman/listinfo/import-sig
signature.asc (application/pgp-signature, 801 B)
-----BEGIN PGP SIGNATURE-----

iQIcBAEBAgAGBQJU8MVGAAoJEG48vOkzctz62OkP/0TbGrh+6m0QGYE5raxwGFjI
OVmvEni5s7HKU65fSmKeYtNL2NJ9UR5GVH9tcSvZHGPd18L+xDD8e7/FLfgIVUM1
cSpyaikKj6vC2brYhnVy2r9Za45qnbtpzIuPt/kwfRL0tgOEkBuWeoeGVkVZ3lcK
49jrkRwSwWckgGILnyplurqHvv7OlNPfKHLu99uBzEZ6djB8SzBX99gDBnxTUgQz
dgJsjswY01qDvg8SdCNt+QrCJvIKt8T8XZD6Q3QIgEAGRBeN/ZS0v7rfGuI9MOYz
CsQFKqc6veHQ/Tq0UEBUzgrCb34QVMttKcGrxcOKa07+QjZk/M4k7HJplnVpsJag
0jAbrgsqvMYm+PYEGY+xoRxBIVNQxjhORXtedq+U6XqbrjNe4mdP6ERjOtgJjeK5
WdtejjJoepPmFYWCBfsb6uMiRVwWhQjAZj2tQtvgV9x0W2inCSs+9BQ9d6lMS+59
0KbrpBduVZUzBB/OA/myX9JkylHcYhidfvIj4h10e9S8Yz7JTFhG/k2O1YVRfdiv
akP5FGAqbFtYq0wMs/od3MwxDa7VvDNoAb4PF3vxaaAXgHkCGbph7NnuUiQRwlcP
0Zo6xnZv/ewAblQaDImHn9x4Kgsxsp4FnvXd4cmxeyH819s/PMTZTrfPJB80fVT3
HBPiXcyvP97Aoi2dbys7
=AaWn
-----END PGP SIGNATURE-----