On Sep 22, 8:13 pm, process <[EMAIL PROTECTED]> wrote:
> Why doesn't Python optimize tailcalls? Are there plans for it?
>
> I know GvR dislikes some of the functional additions like reduce and
> Python is supposedly about "one preferrable way of doing things" but
> not being able to use recursion properly is just a big pain in the
> a**.
I didn't think this through completely-- is it incompatible with
closures and local function definitions?
def f( m ):
def g( n ):
return m+ n
stuff( )
return g( 0 )
In this case, the stack, growing up:
g
f
main
is not equivalent to:
g
main
in the last step, due to the local definition of 'm' in 'f'.
--
http://mail.python.org/mailman/listinfo/python-list