Skip to content

Commit 02ab6bd

Browse files
committed
Change type read-only attributes from @property to Final
1 parent e75a39f commit 02ab6bd

1 file changed

Lines changed: 7 additions & 14 deletions

File tree

‎stdlib/builtins.pyi‎

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -182,28 +182,21 @@ class classmethod(Generic[_T, _P, _R_co]):
182182
@disjoint_base
183183
class type:
184184
# object.__base__ is None. Otherwise, it would be a type.
185-
@property
186-
def __base__(self) -> type | None: ...
185+
__base__: Final[type | None]
187186
__bases__: tuple[type, ...]
188-
@property
189-
def __basicsize__(self) -> int: ...
187+
__basicsize__: Final[int]
190188
# type.__dict__ is read-only at runtime, but that can't be expressed currently.
191189
# See https://github.com/python/typeshed/issues/11033 for a discussion.
192190
__dict__: Final[types.MappingProxyType[str, Any]] # type: ignore[assignment]
193-
@property
194-
def __dictoffset__(self) -> int: ...
195-
@property
196-
def __flags__(self) -> int: ...
197-
@property
198-
def __itemsize__(self) -> int: ...
191+
__dictoffset__: Final[int]
192+
__flags__: Final[int]
193+
__itemsize__: Final[int]
199194
__module__: str
200195
__mro__: Final[tuple[type, ...]]
201196
__name__: str
202197
__qualname__: str
203-
@property
204-
def __text_signature__(self) -> str | None: ...
205-
@property
206-
def __weakrefoffset__(self) -> int: ...
198+
__text_signature__: Final[str | None]
199+
__weakrefoffset__: Final[int]
207200

208201
@overload
209202
def __init__(self, o: object, /) -> None: ...

0 commit comments

Comments
 (0)