-
Notifications
You must be signed in to change notification settings - Fork 2k
Adds type hinting for VersionOrder class
#13385
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
Adds type hinting for VersionOrder class
#13385
Conversation
- Adds type hinting discussed in Issue conda#13380 - Also adds type hints for `InvalidVersionSpec` and related exceptions
|
We require contributors to sign our Contributor License Agreement and we don't have one on file for @schuylermartin45. In order for us to review and merge your code, please e-sign the Contributor License Agreement PDF. We then need to manually verify your signature, merge the PR (conda/infrastructure#857), and ping the bot to refresh the PR. |
|
I've signed the CLA. Not sure if I have the permissions to retry that check. |
|
@conda-bot check |
| return True | ||
|
|
||
| def __eq__(self, other): | ||
| def __eq__(self, other: object) -> bool: |
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 Any be better choice here? I'm wondering why you went with object here.
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.
This is what was suggested from a StackOverflow post I saw a while back. I think it was this one: https://stackoverflow.com/questions/37557411/why-does-defining-the-argument-types-for-eq-throw-a-mypy-type-error
I think I've seen object used in a number of other posts as well, but upon further Googling, some people use Any. On my projects I have the "No explicit Any" rule enabled in mypy so using object also prevents triggering that rule.
Of course, I'm not using the NotImplemented suggestion either and just return False.
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.
LGTM as the input and not the return type: https://stackoverflow.com/questions/39817081/typing-any-vs-object
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.
hm interesting, well I'm all for replacing Any with object throughout conda, one less import
|
Current build failures seemed to be caused by an unrelated HTTP error |
Description
InvalidVersionSpecand related exceptionsChecklist - did you ...
newsdirectory (using the template) for the next release's release notes?