mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Make several fields read-only for type, staticmethod and classmethod (#7423)
This commit is contained in:
@@ -115,8 +115,10 @@ class object:
|
||||
def __init_subclass__(cls) -> None: ...
|
||||
|
||||
class staticmethod(Generic[_R_co]):
|
||||
__func__: Callable[..., _R_co]
|
||||
__isabstractmethod__: bool
|
||||
@property
|
||||
def __func__(self) -> Callable[..., _R_co]: ...
|
||||
@property
|
||||
def __isabstractmethod__(self) -> bool: ...
|
||||
def __init__(self: staticmethod[_R_co], __f: Callable[..., _R_co]) -> None: ...
|
||||
def __get__(self, __obj: _T, __type: type[_T] | None = ...) -> Callable[..., _R_co]: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
@@ -126,8 +128,10 @@ class staticmethod(Generic[_R_co]):
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> _R_co: ...
|
||||
|
||||
class classmethod(Generic[_R_co]):
|
||||
__func__: Callable[..., _R_co]
|
||||
__isabstractmethod__: bool
|
||||
@property
|
||||
def __func__(self) -> Callable[..., _R_co]: ...
|
||||
@property
|
||||
def __isabstractmethod__(self) -> bool: ...
|
||||
def __init__(self: classmethod[_R_co], __f: Callable[..., _R_co]) -> None: ...
|
||||
def __get__(self, __obj: _T, __type: type[_T] | None = ...) -> Callable[..., _R_co]: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
@@ -136,19 +140,28 @@ class classmethod(Generic[_R_co]):
|
||||
__wrapped__: Callable[..., _R_co]
|
||||
|
||||
class type:
|
||||
__base__: type
|
||||
@property
|
||||
def __base__(self) -> type: ...
|
||||
__bases__: tuple[type, ...]
|
||||
__basicsize__: int
|
||||
__dict__: dict[str, Any]
|
||||
__dictoffset__: int
|
||||
__flags__: int
|
||||
__itemsize__: int
|
||||
@property
|
||||
def __basicsize__(self) -> int: ...
|
||||
@property
|
||||
def __dict__(self) -> types.MappingProxyType[str, Any]: ... # type: ignore[override]
|
||||
@property
|
||||
def __dictoffset__(self) -> int: ...
|
||||
@property
|
||||
def __flags__(self) -> int: ...
|
||||
@property
|
||||
def __itemsize__(self) -> int: ...
|
||||
__module__: str
|
||||
__mro__: tuple[type, ...]
|
||||
@property
|
||||
def __mro__(self) -> tuple[type, ...]: ...
|
||||
__name__: str
|
||||
__qualname__: str
|
||||
__text_signature__: str | None
|
||||
__weakrefoffset__: int
|
||||
@property
|
||||
def __text_signature__(self) -> str | None: ...
|
||||
@property
|
||||
def __weakrefoffset__(self) -> int: ...
|
||||
@overload
|
||||
def __init__(self, __o: object) -> None: ...
|
||||
@overload
|
||||
|
||||
Reference in New Issue
Block a user