Fix MutableMapping.update to require string keys (#14099)

This commit is contained in:
Neil Mitchell
2025-05-19 16:55:20 +01:00
committed by GitHub
parent ec8b6eca5e
commit 929aca4026
+7 -3
View File
@@ -797,11 +797,15 @@ class MutableMapping(Mapping[_KT, _VT]):
# -- weakref.WeakValueDictionary.__ior__
# -- weakref.WeakKeyDictionary.__ior__
@overload
def update(self, m: SupportsKeysAndGetItem[_KT, _VT], /, **kwargs: _VT) -> None: ...
def update(self, m: SupportsKeysAndGetItem[_KT, _VT], /) -> None: ...
@overload
def update(self, m: Iterable[tuple[_KT, _VT]], /, **kwargs: _VT) -> None: ...
def update(self: Mapping[str, _VT], m: SupportsKeysAndGetItem[_KT, _VT], /, **kwargs: _VT) -> None: ...
@overload
def update(self, **kwargs: _VT) -> None: ...
def update(self, m: Iterable[tuple[_KT, _VT]], /) -> None: ...
@overload
def update(self: Mapping[str, _VT], m: Iterable[tuple[_KT, _VT]], /, **kwargs: _VT) -> None: ...
@overload
def update(self: Mapping[str, _VT], **kwargs: _VT) -> None: ...
Text = str