staticmethod and classmethod can wrap any callable (#2650)

Closes: #2645
This commit is contained in:
anentropic
2018-11-29 13:36:08 +00:00
committed by Sebastian Rittau
parent 48183b1d27
commit 98e63d2d2f
3 changed files with 18 additions and 18 deletions

View File

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

View File

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

View File

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