[Python-ideas] Python-ideas Digest, Vol 90, Issue 30
Antoine Pitrou
solipsis at pitrou.net
Thu May 22 10:52:20 CEST 2014
On Wed, 21 May 2014 19:04:58 -0400
Ned Batchelder <ned at nedbatchelder.com>
wrote:
>
> I'm not sure what can of worms you are imagining. Let's look to our
> experience with C compilers. They have a switch to disable
> optimization. What trouble has that brought? When I think of problems
> with optimizers in C compilers, I think of incorrect or buggy
> optimizations. I can't think of something that has gone wrong because
> there was a switch to turn it off.
Python's usage model does not contain the notion of compiler
optimizations. Hardly anybody uses the misnamed -O flags. There
is a single compilation mode, which everyone is content with. It is
part of the simplicity of the language (or, at least, of CPython); by
adding some flags than can affect the level of "optimization" you make
the model more complicated to understand for users, and to support for
us.
(having used coverage several times, I haven't found those missed lines
really annoying, by the way; not to the point that I would have wanted
a specific command-line flag to disable optimizations)
The use case for disabling optimizations in C is to make programs
actually debuggable. Python doesn't have that problem.
Regards
Antoine.
More information about the Python-ideas
mailing list