mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-26 03:27:14 +08:00
Misc stub fixes (#181)
This commit is contained in:
committed by
Guido van Rossum
parent
c21d8a41d5
commit
292447bd62
@@ -1,6 +1,6 @@
|
||||
# Stubs for operator
|
||||
|
||||
from typing import Any, Callable
|
||||
from typing import Any, Callable, overload, Tuple
|
||||
|
||||
def __abs__(a: Any) -> Any: ...
|
||||
def __add__(a: Any, b: Any) -> Any: ...
|
||||
@@ -114,14 +114,22 @@ def truediv(a: Any, b: Any) -> Any: ...
|
||||
def truth(x: Any) -> bool: ...
|
||||
def xor(a: Any, b: Any) -> Any: ...
|
||||
|
||||
# Unsupported feature: "If more than one attribute is requested,
|
||||
# returns a tuple of attributes."
|
||||
# Unsupported: more than 3 attributes.
|
||||
# Unsupported: on Python 2 the parameter type should be `basestring`.
|
||||
def attrgetter(attr: str) -> Callable[[Any], Any]: ...
|
||||
@overload
|
||||
def attrgetter(attr1: str) -> Callable[[Any], Any]: ...
|
||||
@overload
|
||||
def attrgetter(attr1: str, attr2: str) -> Callable[[Any], Tuple[Any, Any]]: ...
|
||||
@overload
|
||||
def attrgetter(attr1: str, attr2: str, attr3: str) -> Callable[[Any], Tuple[Any, Any, Any]]: ...
|
||||
|
||||
# Unsupported feature: "If multiple items are specified, returns a
|
||||
# tuple of lookup values."
|
||||
def itemgetter(item: Any) -> Callable[[Any], Any]: ...
|
||||
# Unsupported: more than 3 items.
|
||||
@overload
|
||||
def itemgetter(item1: Any) -> Callable[[Any], Any]: ...
|
||||
@overload
|
||||
def itemgetter(item1: Any, item2: Any) -> Callable[[Any], Tuple[Any, Any]]: ...
|
||||
@overload
|
||||
def itemgetter(item1: Any, item2: Any, item3: Any) -> Callable[[Any], Tuple[Any, Any, Any]]: ...
|
||||
|
||||
# Unsupported: on Python 2 the parameter type should be `basestring`.
|
||||
def methodcaller(name: str, *args, **kwargs) -> Callable[[Any], Any]: ...
|
||||
|
||||
Reference in New Issue
Block a user