-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Description
With this PR #14574, the previous Mapping annotation for the internal mapping attribute of KeysView seems to have been changed to a Viewable protocol:
# Suitable for dictionary view objects
class Viewable(Protocol[_T_co]):
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[_T_co]: ...I was comparing this against CPython's collections.abc
class KeysView(MappingView, Set):
__slots__ = ()
@classmethod
def _from_iterable(cls, it):
return set(it)
def __contains__(self, key):
return key in self._mapping
def __iter__(self):
yield from self._mappingand it appears that self._mapping has now lost the __contains__ (which was previously guaranteed by Mapping). Wanted to raise it here.
Metadata
Metadata
Assignees
Labels
No labels