Steven D'Aprano <[EMAIL PROTECTED]> writes: > > Not tail calls, in general, no. > > Sorry, how does that work? You're suggesting that there is an algorithm > which the compiler could follow to optimize away tail-recursion, but human > beings can't follow the same algorithm? > > Now I'm confused.
The usual compiler method is to translate the code into continuation-passing style and thereby gain tail-recursion optimization automagically. Of course a human could do the same thing in principle, but it would result in insanely difficult-to-write, unreadable and unmaintainable code. At a higher level, there are no Python features whatsoever, either existing or proposed, that couldn't be eliminated and left to the human. Iterators? While loops? Who needs 'em? We could all go back to programming in machine code. But Python is supposed to make programming easier, not harder. -- http://mail.python.org/mailman/listinfo/python-list