Re: PEP for the removal of PYO files

Brett Cannon <[email protected]> Sun, 01 Mar 2015 16:02:30 +0000
Newsgroups gmane.comp.python.import
Message-ID <CAP1=2W7bfcTPFOv=e-sPOZ-+3yRH7Zvr0iYc1b8EqA0XUQpnSw@mail.gmail.com>
On Sat, Feb 28, 2015 at 7:48 PM Nick Coghlan <[email protected]> wrote:

>
> On 1 Mar 2015 07:16, "Brett Cannon" <[email protected]> wrote:
> >
> >
> >
> > On Sat, Feb 28, 2015 at 11:57 AM Antoine Pitrou <[email protected]>
> wrote:
> >>
> >> On Fri, 27 Feb 2015 17:06:59 +0000
> >> Brett Cannon <[email protected]> wrote:
> >> >
> >> > A period was chosen over a hyphen as a separator so as to distinguish
> >> > clearly that the optimization level is not part of the interpreter
> >> > version as specified by the cache tag. It also lends to the use of
> >> > the period in the file name to delineate semantically different
> >> > concepts.
> >>
> >> Indeed but why would other implementations have to mimick CPython here?
> >> Perhaps the whole idea of differing "optimization" levels doesn't make
> >> sense for them.
> >
> >
> > Directly it might not, but if they support the AST module along with
> passing AST nodes to compile() then they would implicitly support
> optimizations for bytecode through custom loaders.
> >
> > I also checked PyPy and IronPython 3 and they both support -O.
> >
> > But an implementation that chose to skip the ast module and not support
> -O is the best argument to support Nick's ask to not specify the
> optimization if it is 0 (although I'm not saying that's enough to sway me
> to change the PEP).
>
> I was only +0 on that particular idea myself, so I agree it's better to
> keep things consistent. However, the PEP should explicitly define what
> happens if the empty string (rather than None) is passed in. Since we need
> to define a standard way of handling that anyway, it could be a reasonable
> API for suppressing the new name segment entirely (even if CPython doesn't
> make use of it outside the test suite).
>

Fair enough. It also provides a way to get to the old file name if it's
desirable for some reason.

I still have the option in the Open Issues section to see what it brings up
in further discussions.

_______________________________________________
Import-SIG mailing list
[email protected]
https://mail.python.org/mailman/listinfo/import-sig