Re: [Python-Dev] deprecating .pyo and -O

2012-06-16 Thread Gregory P. Smith
On Thu, Jun 14, 2012 at 1:57 PM, "Martin v. Löwis" wrote: > > I don't really see the point. In my experience there is no benefit to > > removing assert statements in production mode. This is a C-specific > > notion that doesn't really map very well to Python code. Do other > > high-level languages

Re: [Python-Dev] deprecating .pyo and -O

2012-06-14 Thread Martin v. Löwis
> I don't really see the point. In my experience there is no benefit to > removing assert statements in production mode. This is a C-specific > notion that doesn't really map very well to Python code. Do other > high-level languages have similar functionality? It's not at all C specific. C# also

Re: [Python-Dev] deprecating .pyo and -O

2012-06-14 Thread Steven D'Aprano
Antoine Pitrou wrote: Do other high-level languages have similar functionality? Parrot (does anyone actually use Parrot?) has a byte-code optimizer. javac -O is supposed to emit optimized byte-code, but allegedly it is a no-op. On the other hand, the Java ecosystem includes third-party Java

Re: [Python-Dev] deprecating .pyo and -O

2012-06-14 Thread Antoine Pitrou
On Fri, 15 Jun 2012 06:38:45 +1000 Steven D'Aprano wrote: > > Apart from the duplication of effort (everyone who wants to optimize their > code has to write their own source-code strip tool), Actually, it could be shipped with Python, or even done dynamically at runtime (instead of relying on s

Re: [Python-Dev] deprecating .pyo and -O

2012-06-14 Thread Steven D'Aprano
Floris Bruynooghe wrote: On 14 June 2012 11:25, Antoine Pitrou wrote: Honestly, I think the best option would be to deprecate .pyo files as well as the useless -O option. They only cause confusion without providing any significant benefits. +1 But what happens to __debug__ and assert stateme

Re: [Python-Dev] deprecating .pyo and -O

2012-06-14 Thread Antoine Pitrou
On Thu, 14 Jun 2012 09:14:59 -0400 "R. David Murray" wrote: > > What does matter though is the memory savings. I'm working with an > application where the difference between normal and -OO is around a 10% > savings (about 2MB) in program DATA size at startup, and that makes a > difference for an

Re: [Python-Dev] deprecating .pyo and -O

2012-06-14 Thread R. David Murray
On Thu, 14 Jun 2012 14:14:54 +0200, Antoine Pitrou wrote: > On Thu, 14 Jun 2012 12:58:16 +0100 > Floris Bruynooghe wrote: > > On 14 June 2012 11:25, Antoine Pitrou wrote: > > > Honestly, I think the best option would be to deprecate .pyo files as > > > well as the useless -O option. They only ca

Re: [Python-Dev] deprecating .pyo and -O

2012-06-14 Thread Antoine Pitrou
On Thu, 14 Jun 2012 12:58:16 +0100 Floris Bruynooghe wrote: > On 14 June 2012 11:25, Antoine Pitrou wrote: > > Honestly, I think the best option would be to deprecate .pyo files as > > well as the useless -O option. They only cause confusion without > > providing any significant benefits. > > +1

Re: [Python-Dev] deprecating .pyo and -O

2012-06-14 Thread Floris Bruynooghe
On 14 June 2012 11:25, Antoine Pitrou wrote: > Honestly, I think the best option would be to deprecate .pyo files as > well as the useless -O option. They only cause confusion without > providing any significant benefits. +1 But what happens to __debug__ and assert statements? I think it should

[Python-Dev] deprecating .pyo and -O

2012-06-14 Thread Antoine Pitrou
On Wed, 13 Jun 2012 12:36:55 -0700 Ethan Furman wrote: > > Currently, the alternative to supporting this behavior is to either: > >1) require the end-user to specify -O (major nuisance) > >or > >2) have the distributor rename the .pyo file to .pyc > > I think 1 is a non-starter (n