Edit: I didn't see shakna's comment.
[0] http://neopythonic.blogspot.de/2009/04/tail-recursion-elimin...