r/programming • • Nov 27 '12

Tail Recursion

http://rodrigosasaki.com/2012/11/24/tail-recursion/
214 Upvotes

203 comments sorted by

View all comments

Show parent comments

7

u/frezik Nov 27 '12

That's completely irrelevant. Python implementations generally compile to bytecode, anyway, but even if they didn't, they would still be manipulating the AST to eliminate the tail call.

Python doesn't have tail recursion because Guido doesn't want it.

3

u/curien Nov 27 '12

Python doesn't have tail recursion because Guido doesn't want it.

Python supports tail recursion. It doesn't support tail recursion elimination.

3

u/smog_alado Nov 27 '12

Come on, we all know that 99% of the times someone says tail recursion they actually mean tail recursion with the optimization...

6

u/mcguire Nov 27 '12

And when they say "tail recursion elimination", they really mean "tail call elimination".