Overcoming python's recursion limit.
In most programming languages, you can segfault your program by going too deep in a recursive function. In CPython (the reference implementation that you are probably using), recursion is limited to a fixed number of consecutive recursive calls. The default maximum recursion can be checked by calling sys.getrecursionlimit(). On my machine, this returns 1000 for…