Skip to content

Commit 490e437

Browse files
[typing] Add missing _from_iterable classmethod to Set ABCs
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
1 parent 7ac51d4 commit 490e437

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stdlib/typing.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ class AbstractSet(Collection[_T_co]):
705705
def _hash(self) -> int: ...
706706
# Mixin methods
707707
@classmethod
708-
def _from_iterable(cls, it: Iterable[Any]) -> AbstractSet[Any]: ...
708+
def _from_iterable(cls, it: Iterable[_S]) -> AbstractSet[_S]: ...
709709
def __le__(self, other: AbstractSet[Any]) -> bool: ...
710710
def __lt__(self, other: AbstractSet[Any]) -> bool: ...
711711
def __gt__(self, other: AbstractSet[Any]) -> bool: ...
@@ -739,7 +739,7 @@ class MappingView(Sized):
739739
class ItemsView(MappingView, AbstractSet[tuple[_KT_co, _VT_co]], Generic[_KT_co, _VT_co]):
740740
def __init__(self, mapping: SupportsGetItemViewable[_KT_co, _VT_co]) -> None: ... # undocumented
741741
@classmethod
742-
def _from_iterable(cls, it: Iterable[Any]) -> set[Any]: ...
742+
def _from_iterable(cls, it: Iterable[_S]) -> set[_S]: ...
743743
def __and__(self, other: Iterable[Any]) -> set[tuple[_KT_co, _VT_co]]: ...
744744
def __rand__(self, other: Iterable[_T]) -> set[_T]: ...
745745
def __contains__(self, item: tuple[object, object]) -> bool: ... # type: ignore[override]
@@ -754,7 +754,7 @@ class ItemsView(MappingView, AbstractSet[tuple[_KT_co, _VT_co]], Generic[_KT_co,
754754
class KeysView(MappingView, AbstractSet[_KT_co]):
755755
def __init__(self, mapping: Viewable[_KT_co]) -> None: ... # undocumented
756756
@classmethod
757-
def _from_iterable(cls, it: Iterable[Any]) -> set[Any]: ...
757+
def _from_iterable(cls, it: Iterable[_S]) -> set[_S]: ...
758758
def __and__(self, other: Iterable[Any]) -> set[_KT_co]: ...
759759
def __rand__(self, other: Iterable[_T]) -> set[_T]: ...
760760
def __contains__(self, key: object) -> bool: ...

0 commit comments

Comments
 (0)