Only accept type[Self] in the object.__class__ setter (#13021)

This commit is contained in:
Joren Hammudoglu
2024-11-18 12:34:36 +01:00
committed by GitHub
parent b2c964fdea
commit 480b1ac2e6

View File

@@ -107,7 +107,7 @@ class object:
@property
def __class__(self) -> type[Self]: ...
@__class__.setter
def __class__(self, type: type[object], /) -> None: ...
def __class__(self, type: type[Self], /) -> None: ...
def __init__(self) -> None: ...
def __new__(cls) -> Self: ...
# N.B. `object.__setattr__` and `object.__delattr__` are heavily special-cased by type checkers.