Merge pull request #31 from gnprice/operator

operator: share in 2and3, and make attrgetter and friends usable
This commit is contained in:
matthiaskramm
2015-12-17 15:31:48 -08:00
2 changed files with 10 additions and 14 deletions

View File

@@ -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]: ...

View File

@@ -1,7 +0,0 @@
# Stubs for operator
# NOTE: These are incomplete!
from typing import Any
def add(a: Any, b: Any) -> Any: ...