diff --git a/builtins/2.7/operator.pyi b/builtins/2and3/operator.pyi similarity index 89% rename from builtins/2.7/operator.pyi rename to builtins/2and3/operator.pyi index 4f12ab197..ae5c4ba2d 100644 --- a/builtins/2.7/operator.pyi +++ b/builtins/2and3/operator.pyi @@ -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]: ... diff --git a/builtins/3/operator.pyi b/builtins/3/operator.pyi deleted file mode 100644 index 7785fbe6e..000000000 --- a/builtins/3/operator.pyi +++ /dev/null @@ -1,7 +0,0 @@ -# Stubs for operator - -# NOTE: These are incomplete! - -from typing import Any - -def add(a: Any, b: Any) -> Any: ...