mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-03-12 18:06:45 +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
|
||||
|
||||
@@ -54,6 +54,7 @@ sqlite3.Binary.__contains__ # C type that implements __getitem__
|
||||
builtins.object.__init__ # default C signature is incorrect
|
||||
builtins.property.__get__ # this function can accept no value for the type parameter.
|
||||
builtins.staticmethod.__get__ # this function can accept no value for the type parameter.
|
||||
builtins.type.__dict__ # read-only but not actually a property; stubtest thinks it's a mutable attribute.
|
||||
bz2.BZ2Decompressor.__init__ # function does not accept parameters but C signature is set
|
||||
# The following CodecInfo properties are added in __new__
|
||||
codecs.CodecInfo.decode
|
||||
|
||||
Reference in New Issue
Block a user