mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Improve stubs for classmethod and staticmethod (#10421)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user