Hello.
I was trying to confirm the recursion depth limit, but I have not been able to on v3. It did work on v2. I looked in the issue tracker and have not found anything. Can anyone see something wrong with my example? Or know of some issue? Else will submit it (or submit my lack of understanding). Thank you.
% python3 -V
Python 3.10.6
# on mac
import sys
sys.setrecursionlimit(10)
def adder(i):
if(i <= sys.getrecursionlimit()):
print(i)
return adder(i+1)
adder(1)
% python3 code.py
1
2
3
4
5
6
Traceback (most recent call last):
File "code.py", line 10, in <module>
adder(1)
File "code.py", line 8, in adder
return adder(i+1)
File "code.py", line 8, in adder
return adder(i+1)
File "code.py", line 8, in adder
return adder(i+1)
[Previous line repeated 2 more times]
File "code.py", line 7, in adder
print(i)
RecursionError: maximum recursion depth exceeded while calling a Python object