Return bool from operator comparison functions#6449
Return bool from operator comparison functions#6449AlexWaygood wants to merge 1 commit intopython:masterfrom
bool from operator comparison functions#6449Conversation
|
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.