Duncan Booth wrote: > Tim N. van der Leeuw wrote: > [...] > @tail_recursion > def factorial2(n): > # do the stuff > pass > > your 'do the stuff' actually had an erroneous call to 'factorial'. If you > are going to rename the function you have to rename the recursive calls as > well. (At least, that's what I forgot to do when I first tried it and > couldn't understand why it gave me an answer instead of crashing.) [...]
Duncan, You're totally right. Somehow, I had managed to completely overlook this. Oops! My apologies! :) --Tim -- http://mail.python.org/mailman/listinfo/python-list