Today I Learned…


By Vitor Freitas July 09, 2016

How to change Python recursion limit

This is how you set the maximum depth of the Python interpreter stack to limit. This limit prevents infinite recursion from causing an overflow of the C stack and crashing Python. The limit is platform dependant though.

References

  1. https://docs.python.org/3/library/sys.html#sys.setrecursionlimit

python