Python is not bad ;-)

Dave Angel davea at davea.name
Sat May 2 06:22:20 EDT 2015


On 05/02/2015 05:58 AM, Marko Rauhamaa wrote:
> Chris Angelico <rosuav at gmail.com>:
>
>> Guido is against anything that disrupts tracebacks, and optimizing
>> tail recursion while maintaining traceback integrity is rather harder.
>
> Tail recursion could be suppressed during debugging. Optimized code can
> play all kinds of non-obvious tricks with the execution frame.
>
>> In the situations where it really is simple, you can always make the
>> change in your own code anyway. Often, the process of converting
>> recursion into tail recursion warps the code to the point where it's
>> abusing recursion to implement iteration anyway, so just make it
>> iterative.
>
> While you shouldn't actively replace Python iteration with recursion, I
> strongly disagree that naturally occurring tail recursion is abuse or
> should be avoided in any manner.
>

When you strongly disagree, make sure you're disagreeing with what Chris 
actually said.  The key phrase in his message was
     "converting recursion into tail recursion"

NOT  "converting iteration into recursion"
and NOT "naturally occurring tail recursion"


-- 
DaveA



More information about the Python-list mailing list