Python is not bad ;-)

Mark Lawrence breamoreboy at yahoo.co.uk
Sat May 2 13:22:07 EDT 2015


On 02/05/2015 14:50, Joonas Liik wrote:

[top posting fixed]

>
> On 2 May 2015 at 14:42, Marko Rauhamaa <marko at pacujo.net> wrote:
>
>> Christian Gollwitzer <auriocus at gmx.de>:
>>
>>> That's why I still think it is a microoptimization, which helps only
>>> in some specific cases.
>>
>> It isn't done for performance. It's done to avoid a stack overflow
>> exception.
>>
>>
>> Marko
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
> I agree, stack overflow is literally the main issue that ive run in to
> (tree traversal)
> I've yet to refactor recursion to iterative for speed, but i have done so
> to avoid hitting the stack size limit.
>
> Tree traversal and similar problems in particular lend themselves well to
> recursion and are not quite as trivial to do in an iterative fashion.
>
> I've also found myself constructing an ad-hoc trampoline at least once just
> to sneak past the stack limit.
> (probably very evil but it worked and it wasn't nearly as ugly as it sounds
> like so ill live with it..)
>
>

Please do not top post on this list.  Some of the threads get very long 
and are difficult if not impossible to follow when replies are top 
posted.  Interspersing your replies is the preferred method here, 
failing that simply reply at the bottom, thanks.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence




More information about the Python-list mailing list