-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Return bool from operator comparison functions
#6449
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
Conversation
|
Diff from mypy_primer, showing the effect of this PR on open source code: pandas (https://github.com/pandas-dev/pandas)
+ pandas/io/formats/style.py:3511: error: Unsupported left operand type for & ("object") [operator]
|
|
Returning a non-bool from these methods isn't all that uncommon; numpy arrays do it. Perhaps we could do something fancy here with generic Protocols. (Also, unrelatedly, thanks for all the enthusiasm in improving things! I really appreciate your work here.) |
Thanks 🙂 also, do let me know if I'm being a pain at any point! |
Hmmmm. Do you have anything in mind? I actually wasn't aware of the |
Sorry I missed this. If we had only one operand, it would be something like a protocol with |
Yeah. I tried doing something more ✨fancy✨ in #6448, but a lot of the false-positives seemed to arise from giving e.g. |
|
I think we should also distinguish between |
Just WAIT till you see my next PR |
No description provided.