Home  >  Article  >  Operation and Maintenance  >  How to reset the recursion limit in Python

How to reset the recursion limit in Python

王林
王林forward
2023-05-14 17:04:111037browse

Reset the recursion limit

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

import sys
x=1001
print(sys.getrecursionlimit())
sys.setrecursionlimit(x)
print(sys.getrecursionlimit())
#1-> 1000
#2-> 1001

The above is the detailed content of How to reset the recursion limit in Python. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete