-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TYP: pandas/core/dtypes/base.py #31352
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
Changes from 6 commits
3b4f1a2
3118fbe
e99b84c
9587fd1
4932799
1a14565
f092711
fac519c
fddfabf
89e4f56
b9385d7
11b1b53
9f09895
cf9691f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,7 +74,7 @@ def register(self, dtype: Type[ExtensionDtype]) -> None: | |
|
||
def find( | ||
self, dtype: Union[Type[ExtensionDtype], str] | ||
) -> Optional[Type[ExtensionDtype]]: | ||
) -> Optional[Union[ExtensionDtype, Type[ExtensionDtype]]]: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this changed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. construct_from_string on L98 returns an instance. However, since the type annotations for construct_from_string were removed following #31352 (comment), this can also be removed for now. |
||
""" | ||
Parameters | ||
---------- | ||
|
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.
Did we ever decide on consistent use of Any vs object here? Thought we were using object but maybe missed that
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.
in this class we already have
def __eq__(self, other: Any) -> bool:
and in #29947,Any
was applied throughout.I think it should be
object
in order to check the body of the__eq__
/__ne__
methods, but since we want consistency these will need to be changed as well...__eq__
__ne__
However, doing this raises issues with Extension Array equalities, see #31646. So should be done in a separate PR, I think though that this does affirm the need to use
object
instead ofAny
for more thorough checking.