-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed as not planned
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
When running the below code with Python 3.13.0 on Windows
import functools
import sys
sys.setrecursionlimit(1_000_000)
@functools.cache
def double(n):
return 2 + double(n - 1) if n > 0 else 0
print(f'{double(2_000) = }')
I get the following error
return 2 + double(n - 1) if n > 0 else 0
~~~~~~^^^^^^^
[Previous line repeated 996 more times]
RecursionError: maximum recursion depth exceeded"
It appears that the sys.setrecursionlimit
does not carry over to functools.cache
. The error does not occur when using Python 3.12.3.
CPython versions tested on:
3.13
Operating systems tested on:
Windows
Metadata
Metadata
Assignees
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error