Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions stdlib/3/functools.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ _AnyCallable = Callable[..., Any]

_T = TypeVar("_T")
_S = TypeVar("_S")
_F = TypeVar("_F", bound=_AnyCallable)

@overload
def reduce(function: Callable[[_T, _S], _T],
Expand All @@ -19,19 +20,19 @@ class _CacheInfo(NamedTuple):
maxsize: int
currsize: int

class _lru_cache_wrapper(Generic[_T]):
__wrapped__: Callable[..., _T]
def __call__(self, *args: Any, **kwargs: Any) -> _T: ...
class _lru_cache_wrapper(Generic[_F]):
__wrapped__: _F
__call__: _F
def cache_info(self) -> _CacheInfo: ...
def cache_clear(self) -> None: ...

if sys.version_info >= (3, 8):
@overload
def lru_cache(maxsize: Optional[int] = ..., typed: bool = ...) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ...
def lru_cache(maxsize: Optional[int] = ..., typed: bool = ...) -> Callable[[_F], _lru_cache_wrapper[_F]]: ...
@overload
def lru_cache(maxsize: Callable[..., _T], typed: bool = ...) -> _lru_cache_wrapper[_T]: ...
def lru_cache(maxsize: _F, typed: bool = ...) -> _lru_cache_wrapper[_F]: ...
else:
def lru_cache(maxsize: Optional[int] = ..., typed: bool = ...) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ...
def lru_cache(maxsize: Optional[int] = ..., typed: bool = ...) -> Callable[[_F], _lru_cache_wrapper[_F]]: ...

WRAPPER_ASSIGNMENTS: Sequence[str]
WRAPPER_UPDATES: Sequence[str]
Expand Down