Tail recursion to while iteration in 2 easy steps

random832 at fastmail.us random832 at fastmail.us
Wed Oct 2 10:04:49 EDT 2013


On Wed, Oct 2, 2013, at 9:32, Steven D'Aprano wrote:
> Python is not as aggressively functional as (say) Haskell, but it is 
> surely an exaggeration to suggest that the failure to include tail call 
> optimization means that Python "rejects" functional programming styles. 
> You can still write you code in a functional style, it just won't be as 
> heavily optimized.

IMO, tail call optimization is essential to writing in a functional
style, since otherwise you end up with a stack overflow error on any
input above a trivial size.



More information about the Python-list mailing list