mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Merge pull request #31 from gnprice/operator
operator: share in 2and3, and make attrgetter and friends usable
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Stubs for operator
|
||||
|
||||
from typing import Any
|
||||
from typing import Any, Callable
|
||||
|
||||
def __abs__(a: Any) -> Any: ...
|
||||
def __add__(a: Any, b: Any) -> Any: ...
|
||||
@@ -114,11 +114,14 @@ def truediv(a: Any, b: Any) -> Any: ...
|
||||
def truth(x: Any) -> bool: ...
|
||||
def xor(a: Any, b: Any) -> Any: ...
|
||||
|
||||
class attrgetter(object):
|
||||
def __init__(self, name: Any) -> None: ...
|
||||
# Unsupported feature: "If more than one attribute is requested,
|
||||
# returns a tuple of attributes."
|
||||
# Unsupported: on Python 2 the parameter type should be `basestring`.
|
||||
def attrgetter(attr: str) -> Callable[[Any], Any]: ...
|
||||
|
||||
class itemgetter(object):
|
||||
def __init__(self, key: Any) -> None: ...
|
||||
# Unsupported feature: "If multiple items are specified, returns a
|
||||
# tuple of lookup values."
|
||||
def itemgetter(item: Any) -> Callable[[Any], Any]: ...
|
||||
|
||||
class methodcaller(object):
|
||||
def __init__(self, method_name: str, *args, **kwargs) -> None: ...
|
||||
# Unsupported: on Python 2 the parameter type should be `basestring`.
|
||||
def methodcaller(name: str, *args, **kwargs) -> Callable[[Any], Any]: ...
|
||||
@@ -1,7 +0,0 @@
|
||||
# Stubs for operator
|
||||
|
||||
# NOTE: These are incomplete!
|
||||
|
||||
from typing import Any
|
||||
|
||||
def add(a: Any, b: Any) -> Any: ...
|
||||
Reference in New Issue
Block a user