Skip to content

Commit ea4ae21

Browse files
committed
Revert functools changes
1 parent 9fb53ff commit ea4ae21

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

stdlib/functools.pyi

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ __all__ = [
2525

2626
_T = TypeVar("_T")
2727
_T_co = TypeVar("_T_co", covariant=True)
28-
_R = TypeVar("_R")
2928
_S = TypeVar("_S")
30-
_P = ParamSpec("_P")
3129
_PWrapped = ParamSpec("_PWrapped")
3230
_RWrapped = TypeVar("_RWrapped")
3331
_PWrapper = ParamSpec("_PWrapper")
@@ -56,19 +54,19 @@ class _CacheParameters(TypedDict):
5654
typed: bool
5755

5856
@final
59-
class _lru_cache_wrapper(Generic[_P, _R]):
60-
__wrapped__: Callable[_P, _R]
61-
def __call__(self, *args: _P.args, **kwargs: _P.kwargs) -> _R: ...
57+
class _lru_cache_wrapper(Generic[_T]):
58+
__wrapped__: Callable[..., _T]
59+
def __call__(self, *args: Hashable, **kwargs: Hashable) -> _T: ...
6260
def cache_info(self) -> _CacheInfo: ...
6361
def cache_clear(self) -> None: ...
6462
def cache_parameters(self) -> _CacheParameters: ...
65-
def __copy__(self) -> _lru_cache_wrapper[_P, _R]: ...
66-
def __deepcopy__(self, memo: Any, /) -> _lru_cache_wrapper[_P, _R]: ...
63+
def __copy__(self) -> _lru_cache_wrapper[_T]: ...
64+
def __deepcopy__(self, memo: Any, /) -> _lru_cache_wrapper[_T]: ...
6765

6866
@overload
69-
def lru_cache(maxsize: int | None = 128, typed: bool = False) -> Callable[[Callable[_P, _R]], _lru_cache_wrapper[_P, _R]]: ...
67+
def lru_cache(maxsize: int | None = 128, typed: bool = False) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ...
7068
@overload
71-
def lru_cache(maxsize: Callable[_P, _R], typed: bool = False) -> _lru_cache_wrapper[_P, _R]: ...
69+
def lru_cache(maxsize: Callable[..., _T], typed: bool = False) -> _lru_cache_wrapper[_T]: ...
7270

7371
if sys.version_info >= (3, 14):
7472
WRAPPER_ASSIGNMENTS: Final[
@@ -239,7 +237,7 @@ class cached_property(Generic[_T_co]):
239237
def __set__(self, instance: object, value: _T_co) -> None: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues]
240238
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
241239

242-
def cache(user_function: Callable[_P, _R], /) -> _lru_cache_wrapper[_P, _R]: ...
240+
def cache(user_function: Callable[..., _T], /) -> _lru_cache_wrapper[_T]: ...
243241
def _make_key(
244242
args: tuple[Hashable, ...],
245243
kwds: SupportsItems[Any, Any],

0 commit comments

Comments
 (0)