4 ms·
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.
by Hellios 13y ago
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.
- theseoafs 13y ago^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.