You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
frompandasimportDataFramedf=DataFrame([[1, 2, 3]])
df.columns= ["A", "B", "C"]
columns=df.columns# Typed as "list[str]" instead of "Index".
There are many properties in Pandas which have differently typed getter and setter pairs, like "pandas.DataFrame.columns" here. I do believe that it takes "Iterable[Any]" as the setter argument, which is even wider than the "Union[List[_str], Index[_str]]" declared in the stubs.
I don't think there is guarantee that the result of a property getter would have the same type as the value previously set to the property. Maybe the getter type can be respected?
The text was updated successfully, but these errors were encountered:
Sample:
There are many properties in Pandas which have differently typed getter and setter pairs, like "pandas.DataFrame.columns" here. I do believe that it takes "Iterable[Any]" as the setter argument, which is even wider than the "Union[List[_str], Index[_str]]" declared in the stubs.
I don't think there is guarantee that the result of a property getter would have the same type as the value previously set to the property. Maybe the getter type can be respected?
The text was updated successfully, but these errors were encountered: