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 mark.dickinson
Recipients mark.dickinson, wyz23x2
Date 2020-07-16.08:17:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1594887477.87.0.555612692321.issue41313@roundup.psfhosted.org>
In-reply-to
Content
The recursion depth and recursion limit are stored internally as C ints, so yes, 2**31 - 1 = 2147483647 is the maximum value that you can pass to `sys.setrecursionlimit` that won't fail immediately.

But it's unclear why you'd ever want to set the recursion limit that high. What's your goal here? Are you looking for a way to effectively disable that recursion limit altogether? If so, can you explain the use-case?

Note that the recursion limit is there to prevent your code from exhausting the C stack and segfaulting as a result: simply setting that limit to a huge value won't (by itself) allow you to run arbitrarily deeply nested recursions. On my machine, without the protection of the recursion limit, a simple recursive call segfaults at around a depth of 30800.
History
Date User Action Args
2020-07-16 08:17:57mark.dickinsonsetrecipients: + mark.dickinson, wyz23x2
2020-07-16 08:17:57mark.dickinsonsetmessageid: <1594887477.87.0.555612692321.issue41313@roundup.psfhosted.org>
2020-07-16 08:17:57mark.dickinsonlinkissue41313 messages
2020-07-16 08:17:57mark.dickinsoncreate