Closed
Description
Describe the bug
The tuples
argument type of core.indexes.multi.MultiIndex.from_tuples might be Iterables
, not Sequence
.
Comparison of the function signature in pandas-stub:
and pandas:
https://github.com/pandas-dev/pandas/blob/513e78760a8faee6723908ca23ea83dcabc5dd77/pandas/core/indexes/multi.py#L521
To Reproduce
- Provide a minimal runnable
pandas
example that is not properly checked by the stubs.
import pandas
pandas.MultiIndex.from_tuples(zip(['a'], ['b']))
-
Indicate which type checker you are using (
mypy
orpyright
).
mypy
-
Show the error message received from that type checker while checking your example.
error: Argument 1 to "from_tuples" of "MultiIndex" has incompatible type "zip[tuple[str, str]]"; expected "Sequence[tuple[Hashable, ...]]" [arg-type]
Please complete the following information:
- OS: MacOS
- OS Version: Sequoia 15.3
- python version: Python 3.10
- version of type checker: mypy 1.15.0
- version of installed
pandas-stubs
: 2.2.3.250308
Metadata
Metadata
Assignees
Labels
No labels