-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TYP: _item_cache and _ixs #47506
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
TYP: _item_cache and _ixs #47506
Conversation
@@ -932,7 +932,7 @@ def _take_with_is_copy(self, indices, axis=0) -> Series: | |||
""" | |||
return self.take(indices=indices, axis=axis) | |||
|
|||
def _ixs(self, i: int, axis: int = 0): | |||
def _ixs(self, i: int, axis: int = 0) -> Any: |
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.
Wouldn't mind leaving it un-annotated but I'm also fine using Any
.
Ideally Series
becomes generic as done by @Dr-Irv in the pandas-stubs but that is probably something for the future.
I think slice support was removed in c633579. Looks like this was forgotten back then |
Thanks @MarcoGorelli |
* typ: _item_cache and _ixs * fixup docstring * linting
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.Noticed these in #47497
I have a question about the
_ixs
docstring inframe.py
- it says that if a slice is passed, thenthe result is a view. However, the arguments are annotated to be
int
only. Is the docstringcorrect, or is the type annotation too tight?
I presume it's the former, since I'm not able to pass a slice:
Also, typing
_ixs
as that's what's called withinget_item_cache
.For
Series._ixs
, I've annotated the return type asAny
, as that's what the returntype of
Series.pop
is.