[Python-Dev] peps: Update PEP 399 to include comments from python-dev.

Georg Brandl g.brandl at gmx.net
Wed Apr 13 08:54:00 CEST 2011


On 13.04.2011 02:07, Antoine Pitrou wrote:
> On Tue, 12 Apr 2011 19:50:34 -0400
> Tres Seaver <tseaver at palladion.com> wrote:
>> Trying to accelerate existing code which doesn't have the coverage is
>> insane:  how can you know that the accelerator doesn't subtly change the
>> semantics without tests?
> 
> Well, why do you think tests guarantee that the semantics are the same?
> Tests are not a magic bullet. "Covering" a code path doesn't ensure
> that every possible behaviour is accounted for.

def foo(a, b):
    if condition(a):
        bar = b
    do_something_with(bar)

This has 100% coverage if "condition" is usually true :)

Georg



More information about the Python-Dev mailing list