From 98e63d2d2f196f38c5d753991b7746e8f9c62afd Mon Sep 17 00:00:00 2001 From: anentropic Date: Thu, 29 Nov 2018 13:36:08 +0000 Subject: [PATCH] staticmethod and classmethod can wrap any callable (#2650) Closes: #2645 --- stdlib/2/__builtin__.pyi | 12 ++++++------ stdlib/2/builtins.pyi | 12 ++++++------ stdlib/3/builtins.pyi | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/stdlib/2/__builtin__.pyi b/stdlib/2/__builtin__.pyi index ac6f4f19e..b12ff7664 100644 --- a/stdlib/2/__builtin__.pyi +++ b/stdlib/2/__builtin__.pyi @@ -52,18 +52,18 @@ class object: def __reduce_ex__(self, protocol: int) -> tuple: ... class staticmethod(object): # Special, only valid as a decorator. - __func__ = ... # type: function + __func__ = ... # type: Callable - def __init__(self, f: function) -> None: ... + def __init__(self, f: Callable) -> None: ... def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... - def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> function: ... + def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable: ... class classmethod(object): # Special, only valid as a decorator. - __func__ = ... # type: function + __func__ = ... # type: Callable - def __init__(self, f: function) -> None: ... + def __init__(self, f: Callable) -> None: ... def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... - def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> function: ... + def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable: ... class type(object): __bases__ = ... # type: Tuple[type, ...] diff --git a/stdlib/2/builtins.pyi b/stdlib/2/builtins.pyi index ac6f4f19e..b12ff7664 100644 --- a/stdlib/2/builtins.pyi +++ b/stdlib/2/builtins.pyi @@ -52,18 +52,18 @@ class object: def __reduce_ex__(self, protocol: int) -> tuple: ... class staticmethod(object): # Special, only valid as a decorator. - __func__ = ... # type: function + __func__ = ... # type: Callable - def __init__(self, f: function) -> None: ... + def __init__(self, f: Callable) -> None: ... def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... - def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> function: ... + def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable: ... class classmethod(object): # Special, only valid as a decorator. - __func__ = ... # type: function + __func__ = ... # type: Callable - def __init__(self, f: function) -> None: ... + def __init__(self, f: Callable) -> None: ... def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... - def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> function: ... + def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable: ... class type(object): __bases__ = ... # type: Tuple[type, ...] diff --git a/stdlib/3/builtins.pyi b/stdlib/3/builtins.pyi index fd8568d9e..920225b83 100644 --- a/stdlib/3/builtins.pyi +++ b/stdlib/3/builtins.pyi @@ -59,20 +59,20 @@ class object: def __init_subclass__(cls) -> None: ... class staticmethod: # Special, only valid as a decorator. - __func__ = ... # type: function + __func__ = ... # type: Callable __isabstractmethod__ = ... # type: bool - def __init__(self, f: function) -> None: ... + def __init__(self, f: Callable) -> None: ... def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... - def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> function: ... + def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable: ... class classmethod: # Special, only valid as a decorator. - __func__ = ... # type: function + __func__ = ... # type: Callable __isabstractmethod__ = ... # type: bool - def __init__(self, f: function) -> None: ... + def __init__(self, f: Callable) -> None: ... def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... - def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> function: ... + def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable: ... class type: __bases__ = ... # type: Tuple[type, ...]