Make several fields read-only for type, staticmethod and classmethod (#7423)

This commit is contained in:
Alex Waygood
2022-03-06 23:50:26 +00:00
committed by GitHub
parent ea6e06a60d
commit 1a2f718ceb
2 changed files with 27 additions and 13 deletions

View File

@@ -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