diff --git a/ops/model.py b/ops/model.py index 5eaf89bd3..88ff110d3 100644 --- a/ops/model.py +++ b/ops/model.py @@ -92,6 +92,10 @@ # Copied from typeshed. +_KT = typing.TypeVar("_KT") +_VT_co = typing.TypeVar("_VT_co", covariant=True) + + class _SupportsKeysAndGetItem(typing.Protocol[_KT, _VT_co]): def keys(self) -> typing.Iterable[_KT]: ... def __getitem__(self, __key: _KT) -> _VT_co: ... @@ -1713,6 +1717,7 @@ def __getitem__(self, key: str) -> str: return super().__getitem__(key) def update(self, other: _SupportsKeysAndGetItem[str, str], **kwargs: str): + """Update the data from dict/iterable other and the kwargs.""" super().update(other, **kwargs) def __delitem__(self, key: str):