Nov 28, 2007
[Python-Dev] Proper tail recursion
I just read Guido’s justification for not optimizing tail recursion in Python. It’s laughably weak:
I’m not interested in adding this to the official Python release.
One reason is that if an exception happens in such a tail-recursive call, the stack trace will be confusing.
Another reason is that I don’t think it’s a good idea to try to encourage a Scheme-ish “solve everything with recursion” programming style in Python.
Behold! Python can’t handle the power.
About
Daily Meh is written and edited by Simen (contact me). I live in Norway. This blog is about whatever interests me. Here are some of my favorite posts from the archives.
You can subscribe via RSS.