John Nagle <na...@animats.com> writes: > Python does not do tail recursion, so using recursion > where iteration could do the job is generally a bad idea. Scheme, on > the other hand, always does tail recursion where possible.
I think you mean tail recursion optimization / elimination. Python does tail recursion: >>> def x(n): ... if n == 10: return ... print n ... x(n + 1) ... >>> x(1) 1 2 3 4 5 6 7 8 9 -- John Bokma j3b Blog: http://johnbokma.com/ Facebook: http://www.facebook.com/j.j.j.bokma Freelance Perl & Python Development: http://castleamber.com/ -- http://mail.python.org/mailman/listinfo/python-list