tail-rec decorator, well still blows the stack...

ssecorp circularfunc at gmail.com
Tue Jul 22 05:01:35 CEST 2008


so I try it and when I run:
def fibtr(n):
    def fibt(a, b, n):
        if n <= 1:
            return b
            return fibt(b, a + b, n - 1)
    if n == 0:
        return 0
        return fibt(0, 1, n);

it still blows the stack. so what is the point? is it impossible to
get "real" tail-recursion in Python?

More information about the Python-list mailing list