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

Neil Cerutti horpner at yahoo.com
Wed Jun 13 14:51:27 EDT 2007


On 2007-06-13, Neil Cerutti <horpner at yahoo.com> wrote:
> On 2007-06-13, Anders J. Munch <2007 at jmunch.dk> wrote:
>> General tail-call optimisation is of course completely
>> out-of-bounds for Python, because it ruins tracebacks.  Unlike
>> tail recursion, which could use recursion counters.
>
> Is it really ruined? To use a similar example:

I found some interesting notes by Alex Martelli pertaining to
tail-call optimisation, and my assumption that tail-call
optimization is easier to implement than tail-recursive
optimization may have been naive. ;)

http://groups.google.com/group/comp.lang.python/msg/1a7cccc103c1bd70?hl=en&

Moreover, there are (or were) technical reasons that you can't do
tail-call optimization in Python, which can't even recognize
tail-calls at compile time. According to Tim Peters:

http://groups.google.com/group/comp.lang.python/msg/ea1de1e35aefb828?hl=en&

-- 
Neil Cerutti



More information about the Python-list mailing list