mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
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:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user