mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
15
third_party/2and3/cachetools/decorators.pyi
vendored
15
third_party/2and3/cachetools/decorators.pyi
vendored
@@ -1,11 +1,16 @@
|
||||
from typing import Any, Callable, ContextManager, Optional, TypeVar
|
||||
|
||||
from .cache import Cache
|
||||
from typing import Any, Callable, ContextManager, MutableMapping, Optional, TypeVar
|
||||
|
||||
_KT = TypeVar("_KT")
|
||||
_VT = TypeVar("_VT")
|
||||
_T = TypeVar("_T", bound=Callable[..., Any])
|
||||
_T_co = TypeVar("_T_co", covariant=True)
|
||||
_T_self = TypeVar("_T_self")
|
||||
|
||||
def cached(cache: Cache[_KT, _VT], key: _KT = ..., lock: Optional[ContextManager[_T_co]] = ...) -> Callable[[_T], _T]: ...
|
||||
def cachedmethod(cache: Cache[_KT, _VT], key: _KT = ..., lock: Optional[ContextManager[_T_co]] = ...) -> Callable[[_T], _T]: ...
|
||||
def cached(
|
||||
cache: Optional[MutableMapping[_KT, _VT]], key: Callable[..., _KT] = ..., lock: Optional[ContextManager[_T_co]] = ...
|
||||
) -> Callable[[_T], _T]: ...
|
||||
def cachedmethod(
|
||||
cache: Callable[[_T_self], Optional[MutableMapping[_KT, _VT]]],
|
||||
key: Callable[..., _KT] = ...,
|
||||
lock: Optional[ContextManager[_T_co]] = ...,
|
||||
) -> Callable[[_T], _T]: ...
|
||||
|
||||
Reference in New Issue
Block a user