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

Terry Reedy tjreedy at udel.edu
Thu May 22 08:44:52 CEST 2014


On 5/21/2014 6:59 PM, Ned Batchelder wrote:

> 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.

The presumption of this idea is that there is a proper, canonical 
unoptimized version of 'compiled Python'. For Python there obviously is 
not. For CPython, there is not either. What Raymond has been saying is 
that the output of the CPython compiler is the output of the CPython 
compiler.

Sys.settrace is not intended to mandate. It reports on the operations of 
a particular version of CPython as well as it can with the line number 
table it gets. The existence of the table is not mandated by the 
language definition, but is provided on a best effort basis. Another 
issue on the tracker points out that if an ast is constructed directly, 
and then compiled, then 'source line numbers' has no meaning.

When I used coverage (last summer) with tested Idle modules, I could not 
get a reported 100% coverage because coverage counts the body of a final 
"if __name__ == '__main__':" statement. So I had to visually checked 
that those were the only 'uncovered' lines. I do not see doing the same 
for 'uncovered' continue as much different. In either case, coverage 
could leave such lines out of the denominator.

-- 
Terry Jan Reedy



More information about the Python-ideas mailing list