Skip to content

Commit 98e63d2

Browse files
anentropicsrittau
authored andcommitted
staticmethod and classmethod can wrap any callable (python#2650)
Closes: python#2645
1 parent 48183b1 commit 98e63d2

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

stdlib/2/__builtin__.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,18 @@ class object:
5252
def __reduce_ex__(self, protocol: int) -> tuple: ...
5353

5454
class staticmethod(object): # Special, only valid as a decorator.
55-
__func__ = ... # type: function
55+
__func__ = ... # type: Callable
5656

57-
def __init__(self, f: function) -> None: ...
57+
def __init__(self, f: Callable) -> None: ...
5858
def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ...
59-
def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> function: ...
59+
def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable: ...
6060

6161
class classmethod(object): # Special, only valid as a decorator.
62-
__func__ = ... # type: function
62+
__func__ = ... # type: Callable
6363

64-
def __init__(self, f: function) -> None: ...
64+
def __init__(self, f: Callable) -> None: ...
6565
def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ...
66-
def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> function: ...
66+
def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable: ...
6767

6868
class type(object):
6969
__bases__ = ... # type: Tuple[type, ...]

stdlib/2/builtins.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,18 @@ class object:
5252
def __reduce_ex__(self, protocol: int) -> tuple: ...
5353

5454
class staticmethod(object): # Special, only valid as a decorator.
55-
__func__ = ... # type: function
55+
__func__ = ... # type: Callable
5656

57-
def __init__(self, f: function) -> None: ...
57+
def __init__(self, f: Callable) -> None: ...
5858
def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ...
59-
def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> function: ...
59+
def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable: ...
6060

6161
class classmethod(object): # Special, only valid as a decorator.
62-
__func__ = ... # type: function
62+
__func__ = ... # type: Callable
6363

64-
def __init__(self, f: function) -> None: ...
64+
def __init__(self, f: Callable) -> None: ...
6565
def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ...
66-
def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> function: ...
66+
def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable: ...
6767

6868
class type(object):
6969
__bases__ = ... # type: Tuple[type, ...]

stdlib/3/builtins.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,20 @@ class object:
5959
def __init_subclass__(cls) -> None: ...
6060

6161
class staticmethod: # Special, only valid as a decorator.
62-
__func__ = ... # type: function
62+
__func__ = ... # type: Callable
6363
__isabstractmethod__ = ... # type: bool
6464

65-
def __init__(self, f: function) -> None: ...
65+
def __init__(self, f: Callable) -> None: ...
6666
def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ...
67-
def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> function: ...
67+
def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable: ...
6868

6969
class classmethod: # Special, only valid as a decorator.
70-
__func__ = ... # type: function
70+
__func__ = ... # type: Callable
7171
__isabstractmethod__ = ... # type: bool
7272

73-
def __init__(self, f: function) -> None: ...
73+
def __init__(self, f: Callable) -> None: ...
7474
def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ...
75-
def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> function: ...
75+
def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable: ...
7676

7777
class type:
7878
__bases__ = ... # type: Tuple[type, ...]

0 commit comments

Comments
 (0)