-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: simplify+annotate _shallow_copy #32244
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
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.
@jbrockmendel lgtm
a few inconsistencies between the methods. such as name = self.name if name is no_default else name
vs name = name if name is not lib.no_default else self.name
and name: Label = no_default
vs name: Label = lib.no_default
but not blocker.
return self._simple_new(self._range, name=name) | ||
else: | ||
kwargs.setdefault("name", self.name) | ||
return self._int64index._shallow_copy(values, **kwargs) | ||
return Int64Index._simple_new(values, name=name) |
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.
why is self._int64index replaced with Int64Index? does this affect subclassing?
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.
Using Int64Index is more direct, avoids constructing self._int64index
Shouldn't affect subclasses, which isn't really supported anyway.
Yah, that's just a matter of which modules already have |
thanks |
IntervalIndex is still an outlier, will be handled separately