File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 99 # Fix for lru_cache in Python 3.14+
1010 # See: https://github.com/python/cpython/issues/132064
1111 from functools import wraps
12- from typing import Any , Callable
12+ from typing import Any , Callable , TypeVar
1313
1414 _old_lru_cache = lru_cache
1515
16- def wrapped_lru_cache [T : Callable ](* lru_args , ** lru_kwargs ) -> Callable [[T ], T ]:
17- def decorator (func : T ) -> T :
16+ _T = TypeVar ("_T" , bound = Callable )
17+
18+ def wrapped_lru_cache (* lar : Any , ** lkw : Any ) -> Callable [[_T ], _T ]:
19+ def decorator (func : _T ) -> _T :
1820 @wraps (func )
19- def wrapper (* args : Any , ** kwargs : Any ) -> Any :
20- return _old_lru_cache (* lru_args , ** lru_kwargs )(func )(* args , ** kwargs )
21+ def wrapper (* ar : Any , ** kw : Any ) -> Any :
22+ return _old_lru_cache (* lar , ** lkw )(func )(* ar , ** kw )
2123
2224 return wrapper # type: ignore
2325
2426 return decorator
2527
26- lru_cache = wrapped_lru_cache
28+ lru_cache = wrapped_lru_cache # type: ignore
2729
2830
2931# ===================================================================================
You can’t perform that action at this time.
0 commit comments