Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can increase the recursion limit like this:

import sys

sys.setrecursionlimit(x)

Kind of a "hackish" way to do things but you can do it if you need to.



^Although I think the idea is that you shouldn't need to. Any recursive implementation can either be easily translated to work iteratively, or can be implemented in such a way that 1000 levels of recursion should be more than enough.

For example, 1000 levels of recursion is more than enough to count all the nodes in a binary tree unless the tree is extremely poorly balanced or inordinately large.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: