DOC: change tuples
param for MultiIndex.from_tuples from sequence to iterable
#61357
Open
1 task done
Labels
Pandas version checks
main
hereLocation of the documentation
https://pandas.pydata.org/docs/reference/api/pandas.MultiIndex.from_tuples.html#pandas.MultiIndex.from_tuples
The docs currently say this for the
tuples
parameter:Documentation problem
Pandas-stubs annotates the parameter as sequence: https://github.com/pandas-dev/pandas-stubs/blob/main/pandas-stubs/core/indexes/multi.pyi#L49
Pandas source code annotates the parameter as iterable: https://github.com/pandas-dev/pandas/blob/main/pandas/core/indexes/multi.py#L521
Typing the parameter as sequence prevents this pattern from typechecking, even if it works at runtime:
This was raised in pandas-dev/pandas-stubs#1158
Suggested fix for documentation
Could we loosen the type annotation in the docs to say iterable? Then I can update pandas-stubs to match.
The text was updated successfully, but these errors were encountered: