Skip to content

GH1158 change type of tuples param for MultiIndex.from_tuples #1201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pandas-stubs/core/indexes/multi.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from collections.abc import (
Callable,
Hashable,
Iterable,
Sequence,
)
from typing import (
Expand Down Expand Up @@ -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: ...
Expand Down
4 changes: 4 additions & 0 deletions tests/test_indexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down