Python's "only one way to do it" philosophy isn't good?

John Nagle nagle at animats.com
Wed Jun 13 05:12:04 CEST 2007


Alexander Schmolck wrote:
> Steven D'Aprano <steve at REMOVE.THIS.cybersource.com.au> writes:
>>On Mon, 11 Jun 2007 01:28:09 +0100, Alexander Schmolck wrote:
>>>Steven D'Aprano <steve at REMOVE.THIS.cybersource.com.au> writes:

>>Don't keep us in suspense. What do you believe is the true reason?
> 
> 
> It's easier to spot that some rationalization is bogus than to unconver the
> true underlying causes; I'm pretty sure it's more a Gestalt thing than a
> compelling technical reason.

    There's a real reason.  Remember, functions are dynamically
replaceable.  The compiler would have to detect that the function
doesn't modify or replace itself while recursing for this optimization
to be valid.  Worst case, another thread could replace the function
while it was recursing, invalidating the tail recursion optimization.

				John Nagle



More information about the Python-list mailing list