stdlib: Annotate type.__prepare__ to return a mutable object (#11093)

During class creation, the namespace returned by `__prepare__` is
populated when the class body is executed. Therefore, it must be
mutable.
This commit is contained in:
Simon Lanzmich
2023-12-03 23:46:33 +01:00
committed by GitHub
parent 77ff987b57
commit fe48f37bf7

View File

@@ -203,7 +203,7 @@ class type:
def __instancecheck__(self, __instance: Any) -> bool: ...
def __subclasscheck__(self, __subclass: type) -> bool: ...
@classmethod
def __prepare__(metacls, __name: str, __bases: tuple[type, ...], **kwds: Any) -> Mapping[str, object]: ...
def __prepare__(metacls, __name: str, __bases: tuple[type, ...], **kwds: Any) -> MutableMapping[str, object]: ...
if sys.version_info >= (3, 10):
def __or__(self, __value: Any) -> types.UnionType: ...
def __ror__(self, __value: Any) -> types.UnionType: ...