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 <ma...@pacujo.net> wrote: > Christian Gollwitzer <aurio...@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 >
-- https://mail.python.org/mailman/listinfo/python-list