At the beginning of the month, I was still annoyed that GvR doesn't want tail-call optimization in Python - because he thinks that this is a feature that cannot have a simple interface. On [Lambda the Ultimate] there is also a comment on this - because logically, this statement by GvR has led to some amusement in the Lisp community. Especially cute about this: there is a solution to optimize tail calls via decorator - where Python simply fiddles around in the stack (thanks to stack introspection, this works quite well). So much for the topic of Rube Goldberg Device - the decorator is extremely compact, there is really not much complexity contained. Of course, the optimization is not really optimal - it avoids stack overflow, but uses exception handling to avoid function calls, which then affects performance a bit. But for the simple transfer of recursive algorithms, this can still be quite useful.

And why is something like this not built directly into Python as a better, more efficient solution? Python 2.5 gets conditional expressions inherited from Perl (value if condition else othervalue), but not something like a simple decorator to optimize certain function calls?