- Home>
- today I learned>
- TIL: Python recursion limits
Today I learned that you can get (sys.getrecursionlimit()
) and set (sys.setrecursionlimit(limit)
) the Python interpreter’s maximum stack depth. I can see that on my system, the maximum stack depth or recursion limit is 3000. Exceeding the limit results in a RecursionError
.
This came up in a Prefect flow using a LocalDaskExecutor that attempted to serialize an object with cloudpickle that failed with RecursionError
.