Improve stubs for classmethod and staticmethod (#10421)

This commit is contained in:
Alex Waygood
2023-07-19 12:32:04 +01:00
committed by GitHub
parent 61914253a0
commit 1088ab3d93
2 changed files with 10 additions and 4 deletions

View File

@@ -132,6 +132,9 @@ class staticmethod(Generic[_P, _R_co]):
@property
def __isabstractmethod__(self) -> bool: ...
def __init__(self, __f: Callable[_P, _R_co]) -> None: ...
@overload
def __get__(self, __instance: None, __owner: type) -> Callable[_P, _R_co]: ...
@overload
def __get__(self, __instance: _T, __owner: type[_T] | None = None) -> Callable[_P, _R_co]: ...
if sys.version_info >= (3, 10):
__name__: str
@@ -142,16 +145,19 @@ class staticmethod(Generic[_P, _R_co]):
class classmethod(Generic[_T, _P, _R_co]):
@property
def __func__(self) -> Callable[Concatenate[_T, _P], _R_co]: ...
def __func__(self) -> Callable[Concatenate[type[_T], _P], _R_co]: ...
@property
def __isabstractmethod__(self) -> bool: ...
def __init__(self, __f: Callable[Concatenate[_T, _P], _R_co]) -> None: ...
def __init__(self, __f: Callable[Concatenate[type[_T], _P], _R_co]) -> None: ...
@overload
def __get__(self, __instance: _T, __owner: type[_T] | None = None) -> Callable[_P, _R_co]: ...
@overload
def __get__(self, __instance: None, __owner: type[_T]) -> Callable[_P, _R_co]: ...
if sys.version_info >= (3, 10):
__name__: str
__qualname__: str
@property
def __wrapped__(self) -> Callable[Concatenate[_T, _P], _R_co]: ...
def __wrapped__(self) -> Callable[Concatenate[type[_T], _P], _R_co]: ...
class type:
@property