Python is not bad ;-)

Joonas Liik liik.joonas at gmail.com
Sat May 2 09:50:58 EDT 2015


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..)


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20150502/f4151ff6/attachment.html>


More information about the Python-list mailing list