diff --git a/stdlib/@tests/test_cases/builtins/check_dict.py b/stdlib/@tests/test_cases/builtins/check_dict.py index fe74ad49408e..ea04ff24dc80 100644 --- a/stdlib/@tests/test_cases/builtins/check_dict.py +++ b/stdlib/@tests/test_cases/builtins/check_dict.py @@ -155,6 +155,11 @@ def test12() -> str: return d_str.get("key", int_value) # type: ignore[arg-type] +def test_dict_view_isdisjoint(d: dict[str, int]) -> None: + assert_type(d.keys().isdisjoint([1]), bool) + assert_type(d.items().isdisjoint([1]), bool) + + # Tests for `dict.__(r)or__`. diff --git a/stdlib/_collections_abc.pyi b/stdlib/_collections_abc.pyi index 6fc32078532e..d172db94109d 100644 --- a/stdlib/_collections_abc.pyi +++ b/stdlib/_collections_abc.pyi @@ -75,7 +75,7 @@ class dict_keys(KeysView[_KT_co], Generic[_KT_co, _VT_co]): # undocumented def __reversed__(self) -> Iterator[_KT_co]: ... __hash__: ClassVar[None] # type: ignore[assignment] if sys.version_info >= (3, 13): - def isdisjoint(self, other: Iterable[_KT_co], /) -> bool: ... + def isdisjoint(self, other: Iterable[object], /) -> bool: ... @property def mapping(self) -> MappingProxyType[_KT_co, _VT_co]: ... @@ -92,7 +92,7 @@ class dict_items(ItemsView[_KT_co, _VT_co]): # undocumented def __reversed__(self) -> Iterator[tuple[_KT_co, _VT_co]]: ... __hash__: ClassVar[None] # type: ignore[assignment] if sys.version_info >= (3, 13): - def isdisjoint(self, other: Iterable[tuple[_KT_co, _VT_co]], /) -> bool: ... + def isdisjoint(self, other: Iterable[object], /) -> bool: ... @property def mapping(self) -> MappingProxyType[_KT_co, _VT_co]: ...