diff --git a/pandas-stubs/core/indexes/multi.pyi b/pandas-stubs/core/indexes/multi.pyi index 13af9c68b..b335ed204 100644 --- a/pandas-stubs/core/indexes/multi.pyi +++ b/pandas-stubs/core/indexes/multi.pyi @@ -1,6 +1,7 @@ from collections.abc import ( Callable, Hashable, + Iterable, Sequence, ) from typing import ( @@ -46,7 +47,7 @@ class MultiIndex(Index[Any]): @classmethod def from_tuples( cls, - tuples: Sequence[tuple[Hashable, ...]], + tuples: Iterable[tuple[Hashable, ...]], sortorder: int | None = ..., names: SequenceNotStr[Hashable] = ..., ) -> Self: ... diff --git a/tests/test_indexes.py b/tests/test_indexes.py index 1c91add0b..c54b93760 100644 --- a/tests/test_indexes.py +++ b/tests/test_indexes.py @@ -94,6 +94,10 @@ def test_multiindex_constructors() -> None: ), pd.MultiIndex, ) + check( + assert_type(pd.MultiIndex.from_tuples(zip([1, 2], [3, 4])), pd.MultiIndex), + pd.MultiIndex, + ) check( assert_type(pd.MultiIndex.from_tuples([(1, 3), (2, 4)]), pd.MultiIndex), pd.MultiIndex,