Change of index values dtype should be reflected in index type by josteinbf · Pull Request #9974 · pandas-dev/pandas (original) (raw)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that in some cases Python will automatically treat an in-place operation like x += y
as x = x + y
, e.g., if you implement __add__
but not __iadd__
. This is how inplace operations work on integers, for example, which are immutable.
In any case, this should certainly fail with TypeError
if index
is the same object on both these lines.