Remove SupportsGetItem.__contains__ (#13541)

This commit is contained in:
Sebastian Rittau
2025-03-03 15:44:26 +01:00
committed by GitHub
parent 6d6e858e63
commit 96c3fe712a
+1 -4
View File
@@ -151,11 +151,8 @@ class SupportsKeysAndGetItem(Protocol[_KT, _VT_co]):
def keys(self) -> Iterable[_KT]: ...
def __getitem__(self, key: _KT, /) -> _VT_co: ...
# This protocol is currently under discussion. Use SupportsContainsAndGetItem
# instead, if you require the __contains__ method.
# See https://github.com/python/typeshed/issues/11822.
# stable
class SupportsGetItem(Protocol[_KT_contra, _VT_co]):
def __contains__(self, x: Any, /) -> bool: ...
def __getitem__(self, key: _KT_contra, /) -> _VT_co: ...
# stable