[Python-ideas] Python-ideas Digest, Vol 90, Issue 30

Ned Batchelder ned at nedbatchelder.com
Thu May 22 00:59:38 CEST 2014


On 5/21/14 6:17 PM, Paul Moore wrote:
> On 21 May 2014 22:24, Antoine Pitrou <solipsis at pitrou.net> wrote:
>> On Wed, 21 May 2014 20:44:24 +0100
>> Raymond Hettinger
>> <raymond.hettinger at gmail.com> wrote:
>>> I think this opens a can of worms that is better left closed.
>> FWIW, I agree with Raymond's arguments here.
> I tend to agree as well. It's a pretty specialised case, and
> presumably tools similar to coverage for languages like C manage to
> deal with the issue.
Yes, C and its tools have a way to deal with this.  Are you familiar 
with the -O0 switch?  It disables optimization.

BTW: As C programmers know, if you want to debug your program, you use 
the -O0 switch.  Debugging is about reasoning about the code rather than 
executing it.  Trying to debug optimized C code is very difficult, 
because nothing matches your expectations.

If, as others in this thread have said, we expect the set of 
optimizations to grow, the need for an off switch will become greater, 
even to debug the code.
>
> Like Raymond, I can't quite explain my reservations, but it feels like
> this proposal leans towards overspecifying implementation details, in
> a way that will limit future development of the optimiser.
If by implementation details, you mean the word "peephole", then let's 
remove it, and simply have a switch that disables all optimization.  
Rather than limiting the future of the optimizer, it will provide an 
escape hatch for people who would rather not have the optimizer's effects.

--Ned.
> Paul
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/



More information about the Python-ideas mailing list