Skip to content

Commit ae49713

Browse files
committed
Fix dict view isdisjoint parameter types
1 parent 1b11667 commit ae49713

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

stdlib/@tests/test_cases/builtins/check_dict.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ def test12() -> str:
155155
return d_str.get("key", int_value) # type: ignore[arg-type]
156156

157157

158+
def test_dict_view_isdisjoint(d: dict[str, int]) -> None:
159+
assert_type(d.keys().isdisjoint([1]), bool)
160+
assert_type(d.items().isdisjoint([1]), bool)
161+
162+
158163
# Tests for `dict.__(r)or__`.
159164

160165

stdlib/_collections_abc.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class dict_keys(KeysView[_KT_co], Generic[_KT_co, _VT_co]): # undocumented
7575
def __reversed__(self) -> Iterator[_KT_co]: ...
7676
__hash__: ClassVar[None] # type: ignore[assignment]
7777
if sys.version_info >= (3, 13):
78-
def isdisjoint(self, other: Iterable[_KT_co], /) -> bool: ...
78+
def isdisjoint(self, other: Iterable[object], /) -> bool: ...
7979

8080
@property
8181
def mapping(self) -> MappingProxyType[_KT_co, _VT_co]: ...
@@ -92,7 +92,7 @@ class dict_items(ItemsView[_KT_co, _VT_co]): # undocumented
9292
def __reversed__(self) -> Iterator[tuple[_KT_co, _VT_co]]: ...
9393
__hash__: ClassVar[None] # type: ignore[assignment]
9494
if sys.version_info >= (3, 13):
95-
def isdisjoint(self, other: Iterable[tuple[_KT_co, _VT_co]], /) -> bool: ...
95+
def isdisjoint(self, other: Iterable[object], /) -> bool: ...
9696

9797
@property
9898
def mapping(self) -> MappingProxyType[_KT_co, _VT_co]: ...

0 commit comments

Comments
 (0)