Message389848
user@development:~$ python3
Python 3.7.3 (default, Jan 22 2021, 20:04:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
def recurse(n):
print(n)
try:
recurse(n+1)
except RecursionError:
print("recursion error")
print(n)
Please note that there are 2 print(n) on the same level.
>>> recurse(0)
0
1
2
...
994
995
recursion error
994
993
...
2
1
0
Why is there no 2nd 995 after the recursion error?
Same happens for python 3.8.8 and 3.9.2.
Related question:
I also tried to set sys.setrecursionlimit(100000) and ran recurse(0), but at a bit beyond 21800, it just segfaulted.
Is there a way to determine the practically working maximum it can do? |
|
Date |
User |
Action |
Args |
2021-03-30 19:50:29 | ThomasWaldmann2 | set | recipients:
+ ThomasWaldmann2 |
2021-03-30 19:50:29 | ThomasWaldmann2 | set | messageid: <1617133829.55.0.126108093558.issue43674@roundup.psfhosted.org> |
2021-03-30 19:50:29 | ThomasWaldmann2 | link | issue43674 messages |
2021-03-30 19:50:29 | ThomasWaldmann2 | create | |
|