Skip to content

Commit 0d22fe9

Browse files
authored
Add __name__/__qualname__/__wrapped__ to staticmethod/classmethod
These attributes have all been added in Python 3.10+; see python/cpython#25268
1 parent 49e5b52 commit 0d22fe9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

stdlib/builtins.pyi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ class staticmethod(object): # Special, only valid as a decorator.
122122
def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ...
123123
def __get__(self, __obj: _T, __type: Type[_T] | None = ...) -> Callable[..., Any]: ...
124124
if sys.version_info >= (3, 10):
125+
__name__: str
126+
__qualname__: str
127+
__wrapped__: Callable[..., Any]
125128
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
126129

127130
class classmethod(object): # Special, only valid as a decorator.
@@ -130,6 +133,10 @@ class classmethod(object): # Special, only valid as a decorator.
130133
def __init__(self, __f: Callable[..., Any]) -> None: ...
131134
def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ...
132135
def __get__(self, __obj: _T, __type: Type[_T] | None = ...) -> Callable[..., Any]: ...
136+
if sys.version_info >= (3, 10):
137+
__name__: str
138+
__qualname__: str
139+
__wrapped__: Callable[..., Any]
133140

134141
class type(object):
135142
__base__: type

0 commit comments

Comments
 (0)