8000 Fix cachetools decorators by JHeilCoveo · Pull Request #5690 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

Fix cachetools decorators #5690

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2021
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions stubs/cachetools/cachetools/decorators.pyi
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from _typeshed import IdentityFunction
from typing import Any, Callable, ContextManager, MutableMapping, Optional, TypeVar

_KT = TypeVar("_KT")
_T = TypeVar("_T", bound=Callable[..., Any])

def cached(
cache: Optional[MutableMapping[_KT, Any]], key: Callable[..., _KT] = ..., lock: Optional[ContextManager[Any]] = ...
) -> Callable[[_T], _T]: ...
) -> IdentityFunction: ...
def cachedmethod(
cache: Callable[[Any], Optional[MutableMapping[_KT, Any]]],
key: Callable[..., _KT] = ...,
lock: Optional[ContextManager[Any]] = ...,
) -> Callable[[_T], _T]: ...
) -> IdentityFunction: ...
16 changes: 8 additions & 8 deletions stubs/cachetools/cachetools/func.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Any, Callable, Optional, Sequence, TypeVar
from _typeshed import IdentityFunction
from typing import Callable, Optional, Sequence, TypeVar

_T = TypeVar("_T")

_F = TypeVar("_F", bound=Callable[..., Any])
_RET = Callable[[_F], _F]

def lfu_cache(maxsize: float = ..., typed: bool = ...) -> _RET[_F]: ...
def lru_cache(maxsize: float = ..., typed: bool = ...) -> _RET[_F]: ...
def rr_cache(maxsize: float = ..., choice: Optional[Callable[[Sequence[_T]], _T]] = ..., typed: bool = ...) -> _RET[_F]: ...
def ttl_cache(maxsize: float = ..., ttl: float = ..., timer: float = ..., typed: bool = ...) -> _RET[_F]: ...
def lfu_cache(maxsize: float = ..., typed: bool = ...) -> IdentityFunction: ...
def lru_cache(maxsize: float = ..., typed: bool = ...) -> IdentityFunction: ...
def rr_cache(
maxsize: float = ..., choice: Optional[Callable[[Sequence[_T]], _T]] = ..., typed: bool = ...
) -> IdentityFunction: ...
def ttl_cache(maxsize: float = ..., ttl: float = ..., timer: float = ..., typed: bool = ...) -> IdentityFunction: ...
0