This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ThomasWaldmann2
Recipients ThomasWaldmann2
Date 2021-03-30.19:50:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1617133829.55.0.126108093558.issue43674@roundup.psfhosted.org>
In-reply-to
Content
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?
History
Date User Action Args
2021-03-30 19:50:29ThomasWaldmann2setrecipients: + ThomasWaldmann2
2021-03-30 19:50:29ThomasWaldmann2setmessageid: <1617133829.55.0.126108093558.issue43674@roundup.psfhosted.org>
2021-03-30 19:50:29ThomasWaldmann2linkissue43674 messages
2021-03-30 19:50:29ThomasWaldmann2create