see discussion in https://github\.com/python/typing/pull/273\.
@AbstractMethod
|
# TODO: We wish the key type could also be covariant, but that doesn't work, |
|
# see discussion in https://github.com/python/typing/pull/273. |
|
# @abstractmethod |
key/value pairs.
"""
# TODO: We wish the key type could also be covariant, but that doesn't work,
# see discussion in https://github.com/python/typing/pull/273.
# @abstractmethod
def __getitem__(self, key: _KT, /) -> _VT_co: raise AssumedToBeImplementedException
# Mixin methods
@overload
def get(self, key: _KT, /) -> _VT_co | None: raise AssumedToBeImplementedException
@overload
def get(self, key: _KT, default: _VT_co, /) -> _VT_co: raise AssumedToBeImplementedException # type: ignore[misc]
@overload
def get(self, key: _KT, default: _T, /) -> _VT_co | _T: raise AssumedToBeImplementedException
def get(self, key: _KT, default: None | _VT_co | _T = None, /) -> _VT_co | _T | None:
"""
D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.
"""
raise AssumedToBeImplementedException
# # def items(self) -> ItemsView[_KT, _VT_co]: ...
# def items(self) -> IsItemsView[_KT, _VT_co]:
# """
# D.items() -> a set-like object providing a view on D's items
see discussion in https://github\.com/python/typing/pull/273\.
@AbstractMethod
omnipy/src/omnipy/shared/protocols/typing.py
Lines 937 to 939 in 0339004