-
-
Notifications
You must be signed in to change notification settings - Fork 145
Closed
Labels
Description
Describe the bug
a = pd.Series({0:0, 1:1})
reveal_type(a.keys()
print(type(a.keys())
Running pyright on this code gives you
information: Type of "a.keys()" is "list[Unknown]"
Which is normal since it's written explictly here :
pandas-stubs/pandas-stubs/core/series.pyi
Line 655 in 583d198
def keys(self) -> list: ... |
However, if we run it with python, we get pandas.core.indexes.base.Index
Should we replace the linked line from list
to Index
?
I have a code that is failing type checking because it call a.keys().tolist()
, while it does work as intended.