On Apr 6, 2011, at 4:44 PM, s...@pobox.com wrote:

>    Brett> How about the test suite needs to have 100% test coverage (or as
>    Brett> close as possible) on the pure Python version?
> 
> Works for me, but you will have to define what "100%" is fairly clearly.
> 100% of the lines get executed?  All the branches are taken?  Under what
> circumstances might the 100% rule be relaxed?

And...does that include all branches taken within the interpreter too? :)

E.g. check whether all possible exceptions are thrown in all possible places an 
exception could be thrown? (As per the exception compatibility subthread)

And what about all the possible crazy stuff you could do in callbacks back to 
user code (e.g. mutating arguments passed to the initial function, or 
installing a trace hook or...)?

Does use of the function as a class attribute need to be covered? (see previous 
discussion on differences in behavior due to descriptors).

Etcetc.

I'd love it if CPython C modules acted equivalently to python code, but there 
is almost an endless supply of differences...100% test coverage of the behavior 
seems completely infeasible if interpreted strictly; some explicit subset of 
all possible behavior needs to be defined for what users cannot reasonably 
depend on. (sys.settrace almost certainly belonging on that list :).)

James
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to