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

Steve Howell showell30 at
Wed Jun 13 06:15:22 CEST 2007

--- John Nagle <nagle at> wrote:
>     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.

You would just change the language definition to say
that once you enter f(), any call to f() from within
f() behaves as if the recursively called f() still
points to the originally bound version of f.  To want
any other behavior would be absurd, anyhow. 

I could see the utility of this restriction even
without optimization.

Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.  

More information about the Python-list mailing list