[Previous line repeated 993 more times] Recursion Error: maximum recursion depth exceeded while calling a Python object
def rec(n):
if n>0:
print(n)
return rec(n-1)
rec(1000)
[Previous line repeated 993 more times] Recursion Error: maximum recursion depth exceeded while calling a Python object
def rec(n):
if n>0:
print(n)
return rec(n-1)
rec(1000)
That "recursion limit" includes all active calls, not merely the ones in your recursive function. There are several "overhead" calls in getting to the start of your main program. The stack trace includes only the frames starting with your main program; it appears that there are 7 "overhead" calls and a limit of 1000 frames, resulting in your 993 frames reported in the trace-back.