-
-
Notifications
You must be signed in to change notification settings - Fork 147
type IndexOpsMixin #1357
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
type IndexOpsMixin #1357
Conversation
8a1df28
to
396ab9c
Compare
396ab9c
to
43b25af
Compare
SupportsDType, | ||
np_1darray, | ||
) | ||
from pandas.util._decorators import cache_readonly | ||
|
||
_ListLike: TypeAlias = ArrayLike | dict[str, np.ndarray] | SequenceNotStr[S1] |
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 why this gets redefined in multiple files, but i've kept to the pattern
ok, or better to redefine in _typing
?
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.
If you do want to use it here, then I think moving the definition to typing.pyi
makes sense, but exercise care on the naming, because there is a ListLike
in _typing
that is used elsewhere and I'm not sure whether they should be the same or not. Maybe the name _ListLike
is misleading.
Might be better to do the copying like you've done here, OR have series.pyi
import _ListLike
from core/base.pyi
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.
Might be better to do the copying like you've done here
sure, keeping like this for now then, thanks
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.
ping when I should do the full review, but it looks OK for now
SupportsDType, | ||
np_1darray, | ||
) | ||
from pandas.util._decorators import cache_readonly | ||
|
||
_ListLike: TypeAlias = ArrayLike | dict[str, np.ndarray] | SequenceNotStr[S1] |
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.
If you do want to use it here, then I think moving the definition to typing.pyi
makes sense, but exercise care on the naming, because there is a ListLike
in _typing
that is used elsewhere and I'm not sure whether they should be the same or not. Maybe the name _ListLike
is misleading.
Might be better to do the copying like you've done here, OR have series.pyi
import _ListLike
from core/base.pyi
sure, happy for you to take a look, thanks! |
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.
thanks @MarcoGorelli
closes #1356
assert_type()
to assert the type of any return value