Oct 13, 2017

Reset recursive restrictions in Python

Python limits the number of recursion to 1000, we can reset this value:


import  sys

x = 1001
print ( sys.getrecursionlimit ())

sys . setrecursionlimit ( x )
print ( sys.getrecursionlimit ())

# 1-> 1000
# 2-> 1001