mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Add several Python 3.8 annotations (#3347)
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import sys
|
||||
from typing import Any, Callable, Generic, Dict, Iterable, Mapping, Optional, Sequence, Tuple, Type, TypeVar, NamedTuple, Union, overload
|
||||
|
||||
_AnyCallable = Callable[..., Any]
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_S = TypeVar("_S")
|
||||
|
||||
@overload
|
||||
def reduce(function: Callable[[_T, _S], _T],
|
||||
sequence: Iterable[_S], initial: _T) -> _T: ...
|
||||
@@ -25,10 +27,13 @@ class _lru_cache_wrapper(Generic[_T]):
|
||||
def cache_info(self) -> _CacheInfo: ...
|
||||
def cache_clear(self) -> None: ...
|
||||
|
||||
class lru_cache():
|
||||
def __init__(self, maxsize: Optional[int] = ..., typed: bool = ...) -> None: ...
|
||||
def __call__(self, f: Callable[..., _T]) -> _lru_cache_wrapper[_T]: ...
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
@overload
|
||||
def lru_cache(maxsize: Optional[int] = ..., typed: bool = ...) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ...
|
||||
@overload
|
||||
def lru_cache(maxsize: Callable[..., _T], typed: bool = ...) -> _lru_cache_wrapper[_T]: ...
|
||||
else:
|
||||
def lru_cache(maxsize: Optional[int] = ..., typed: bool = ...) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ...
|
||||
|
||||
WRAPPER_ASSIGNMENTS: Sequence[str]
|
||||
WRAPPER_UPDATES: Sequence[str]
|
||||
|
||||
Reference in New Issue
Block a user