-
- Notifications
You must be signed in to change notification settings - Fork 152
Closed
Description
Describe the bug
range objects supplied to the Cartesian product of MultiIndex.from_product should pass type checking:
import pandas as pd mi = pd.MultiIndex.from_product( [range(3), range(5)], )To Reproduce
- Provide a minimal runnable
pandasexample that is not properly checked by the stubs. see above. - Indicate which type checker you are using (
mypyorpyright). mypy. - Show the error message received from that type checker while checking your example.
List item 0 has incompatible type "range"; expected "SequenceNotStr[Hashable] | Series[Any] | Index[Any]"
(ditto for item 1)
(but it would appear that range objects should be viewable as SequenceNotStr[int])
Please complete the following information:
- OS: Windows 10 Pro, 10.0.19045
- python 3.12
- version of type checker: mypy 1.15.0 (via "Mypy Type Checker" extension in VSCode)
- version of installed
pandas-stubs: 2.3.0.250703