Avoiding argument checking in recursive calls
jervisau at gmail.com
Wed Feb 11 04:31:25 EST 2009
> You've merely replaced the 'test n<0' with 'not check' at the expense
> of an additional parameter that has to be passed each time (and the
> additional test 'n<0' for the first iteration).
I think you have missed the point. The OP stated that n<0 could stand
for an expensive
operation, this replaces an expensive check every time with a cheaper
one every time.
I like the idea of the interface that was in the original post.
More information about the Python-list