From 96c3fe712a27fae7b173cd9565cdb34fabcc72b0 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 3 Mar 2025 15:44:26 +0100 Subject: [PATCH] Remove SupportsGetItem.__contains__ (#13541) --- stdlib/_typeshed/__init__.pyi | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/stdlib/_typeshed/__init__.pyi b/stdlib/_typeshed/__init__.pyi index 7201819b2..7d8e30836 100644 --- a/stdlib/_typeshed/__init__.pyi +++ b/stdlib/_typeshed/__init__.pyi @@ -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