-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Experiment: Let SupportsDunderLT
return object
.
#12573
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
3faf17c
to
8307b3c
Compare
SupportsBool
Protocol.SupportsDunderLT
return object
.
This comment has been minimized.
This comment has been minimized.
I'm not a fan of this change. This would decrease the type safety for the common case. For example, |
The change here would affect objects that do have an |
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 seems right to me but I retriggered mypy-primer to get another look.
This comment has been minimized.
This comment has been minimized.
I'm still opposed to this. Overloading the comparison operators to return something other than |
I'd agree with you if it indeed would be fixeable with one or two |
I can't help but be reminded of this comment python/mypy#1020 (comment). As someone who uses numpy daily, I don't find it surprising that |
@srittau @JelleZijlstra With this PR seemingly being stuck, can we at least consider revisiting the |
Diff from mypy_primer, showing the effect of this PR on open source code: ibis (https://github.com/ibis-project/ibis)
- ibis/expr/types/relations.py:2914: error: Value of type variable "SupportsRichComparisonT" of "sorted" cannot be "NumericValue | float" [type-var]
jax (https://github.com/google/jax)
+ jax/_src/pallas/mosaic/pipeline.py:981: error: Unused "type: ignore" comment [unused-ignore]
|
Fixes #12562