[Python-ideas] return from -- breadth of usage

Terry Reedy tjreedy at udel.edu
Mon Jan 20 21:16:06 CET 2014


On 1/20/2014 10:29 AM, spir wrote:
> I think tail call is very common

Yes, they are. That is why space-optimizing all tail calls, and 
destroying proper tracebacks for all tail calls, is gross over-kill. 
Saving space is only needed when recursion would make the stack space 
used grow without any particular bound. (Note that this is only an issue 
for practical implementations, not pure mathematics.)

The point of the 'tail call' proposal is to have the programmer 
explicitly say when space conservation is needed, instead of asking the 
interpreter to magically make that determination.

-- 
Terry Jan Reedy



More information about the Python-ideas mailing list