-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: fix Index's __iadd__ methods #5053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@jreback are you sure this doesn't break back-compat? Seems like it would. |
@jtratner I think its ok; the problem is iadd was using the numpy iadd which effectively does the same thing, but doesn't do the asignment correctly (because its a numpy method and doesn't go thru the python assignment machinery) |
I just don't think you should block the non inplace methods without |
they don't work properly is the issue as they update the Index inplace which is semantically wrong (because its not calling the right method). |
I think it's fine to block inplace, but I thought you were blocking things |
@@ -93,6 +93,9 @@ class Index(FrozenNDArray): | |||
|
|||
_engine_type = _index.ObjectEngine | |||
|
|||
__mul__ = __trudev__ = __floordiv__ = __pow__ = __imul__ = __itruediv__ = \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok..let's just limit these to the i methods you have here: imul,itruediv,ifloordiv,ipow,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure that _disabled
is what you actually want, because it's not that it's immutable, it's that it returns the right type. /bikeshedding
@d10genes ok...this got too complicated! sorry.....let's just do the iadd; rest can do in a separate PR |
iadd...and isub? or just iadd |
Just |
I went ahead and updated the title of this PR to make it clearer what's going on. We definitely appreciate you being game on this - please just remove the If you want, you could open a new pull request with your proposed |
fixes pandas-dev#4996 alias Index's __isub__ to __sub__ document fixes to pandas-dev#4996 index isub test roll back everything non-iadd related
thanks you! |
closes #4996
Aliases iadd = add.
Not doing anything else for now until time to consider.