mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-21 18:42:07 +08:00
Various stubtest fixes (#5215)
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import sys
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Container,
|
||||
Generic,
|
||||
Mapping,
|
||||
MutableMapping,
|
||||
MutableSequence,
|
||||
@@ -14,6 +14,7 @@ from typing import (
|
||||
)
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_T_co = TypeVar("_T_co", covariant=True)
|
||||
_K = TypeVar("_K")
|
||||
_V = TypeVar("_V")
|
||||
|
||||
@@ -148,15 +149,36 @@ if sys.version_info < (3,):
|
||||
if sys.version_info >= (3, 4):
|
||||
def length_hint(__obj: Any, __default: int = ...) -> int: ...
|
||||
|
||||
@overload
|
||||
def attrgetter(attr: str) -> Callable[[Any], Any]: ...
|
||||
@overload
|
||||
def attrgetter(*attrs: str) -> Callable[[Any], Tuple[Any, ...]]: ...
|
||||
@overload
|
||||
def itemgetter(item: Any) -> Callable[[Any], Any]: ...
|
||||
@overload
|
||||
def itemgetter(*items: Any) -> Callable[[Any], Tuple[Any, ...]]: ...
|
||||
def methodcaller(__name: str, *args: Any, **kwargs: Any) -> Callable[..., Any]: ...
|
||||
class attrgetter(Generic[_T_co]):
|
||||
@overload
|
||||
def __new__(cls, attr: str) -> attrgetter[Any]: ...
|
||||
@overload
|
||||
def __new__(cls, attr: str, __attr2: str) -> attrgetter[Tuple[Any, Any]]: ...
|
||||
@overload
|
||||
def __new__(cls, attr: str, __attr2: str, __attr3: str) -> attrgetter[Tuple[Any, Any, Any]]: ...
|
||||
@overload
|
||||
def __new__(cls, attr: str, __attr2: str, __attr3: str, __attr4: str) -> attrgetter[Tuple[Any, Any, Any, Any]]: ...
|
||||
@overload
|
||||
def __new__(cls, attr: str, *attrs: str) -> attrgetter[Tuple[Any, ...]]: ...
|
||||
def __call__(self, obj: Any) -> _T_co: ...
|
||||
|
||||
class itemgetter(Generic[_T_co]):
|
||||
@overload
|
||||
def __new__(cls, item: Any) -> itemgetter[Any]: ...
|
||||
@overload
|
||||
def __new__(cls, item: Any, __item2: Any) -> itemgetter[Tuple[Any, Any]]: ...
|
||||
@overload
|
||||
def __new__(cls, item: Any, __item2: Any, __item3: Any) -> itemgetter[Tuple[Any, Any, Any]]: ...
|
||||
@overload
|
||||
def __new__(cls, item: Any, __item2: Any, __item3: Any, __item4: Any) -> itemgetter[Tuple[Any, Any, Any, Any]]: ...
|
||||
@overload
|
||||
def __new__(cls, item: Any, *items: Any) -> itemgetter[Tuple[Any, ...]]: ...
|
||||
def __call__(self, obj: Any) -> _T_co: ...
|
||||
|
||||
class methodcaller:
|
||||
def __init__(self, __name: str, *args: Any, **kwargs: Any) -> None: ...
|
||||
def __call__(self, obj: Any) -> Any: ...
|
||||
|
||||
def iadd(__a: Any, __b: Any) -> Any: ...
|
||||
def __iadd__(a: Any, b: Any) -> Any: ...
|
||||
def iand(__a: Any, __b: Any) -> Any: ...
|
||||
|
||||
Reference in New Issue
Block a user