Change type.__dict__ to a proper attribute (#14951)

This commit is contained in:
Sebastian Rittau
2025-11-01 03:00:14 +01:00
committed by GitHub
parent bf72147848
commit be34e9201d
3 changed files with 8 additions and 3 deletions
+4 -2
View File
@@ -42,6 +42,7 @@ from typing import ( # noqa: Y022,UP035
Any,
BinaryIO,
ClassVar,
Final,
Generic,
Mapping,
MutableMapping,
@@ -189,8 +190,9 @@ class type:
__bases__: tuple[type, ...]
@property
def __basicsize__(self) -> int: ...
@property
def __dict__(self) -> types.MappingProxyType[str, Any]: ... # type: ignore[override]
# type.__dict__ is read-only at runtime, but that can't be expressed currently.
# See https://github.com/python/typeshed/issues/11033 for a discussion.
__dict__: Final[types.MappingProxyType[str, Any]] # type: ignore[assignment]
@property
def __dictoffset__(self) -> int: ...
@property