recursion depth problem

tac-tics tactics40 at gmail.com
Sun Apr 22 19:05:44 EDT 2007


Yes, you should use a for loop in this situation.

Certain functional languages, such as Scheme and various LISP dialects
allow for what is called "tail recursion" which effectively eliminates
this problem by internally converting recursion to iteration. Python
isn't really cut out for heavy recursive work, and the "Pythonic" way
of doing things is through the lovely for loop.




More information about the Python-list mailing list