Closed
Description
-
I have checked that this issue has not already been reported.
-
I have confirmed this bug exists on the latest version of pandas.
-
(optional) I have confirmed this bug exists on the master branch of pandas.
import pandas as pd
s = pd.Series([1,2,3], name="foo")
reveal_type(s.name)
nam: str = s.name
mypy then reports:
seriesnam.py:5: note: Revealed type is "typing.Hashable*"
seriesnam.py:7: error: Incompatible types in assignment (expression has type "Hashable", variable has type "str") [assignment]
It's natural to assume that the names of a Series are str
So why do we have it typed as Hashable
?
Seems like @simonjayhawkins changed this in #39107