FOR statement

Theerasak Photha hanumizzle at gmail.com
Sat Oct 21 04:11:48 EDT 2006


On 21 Oct 2006 00:50:34 -0700, Ant <antroy at gmail.com> wrote:

> But there's a good reason not to. Try:
>
> printreverse(range(1000))
>
> Recursion has a maximum depth (of 1000 by default) in Python.

I guess Python isn't tail-recursive then?

Well, algorithms seem to be more naturally expressed iteratively in
Python, and to be fair, most uses of recursion you see in e.g., Scheme
textbooks are really just grandstanding in the real world.

-- Theerasak



More information about the Python-list mailing list