Conversation
Probably the best approach is to define the second argument as |
Done! As seen in the code you linked above, this applies to both the first and the second argument though. |
Thanks!
That's actually only partially true. While Python backend will accept
I guess the question is what we really want to support here... I guess these would be great:
but I suspect (?) we might hit some unsafe overlaps at some point, as |
Hi @harpaj. Do you plan to continue working on this? |
Hi, sorry about that, I was busy at the time you wrote and then forgot about it. |
No worries. I just wanted to know if I should take over the issue.
Sure, that's not a big deal however, it looks like MyPy is unhappy with such formulation after all.
Interestingly enough this doesn't occur in isolation, i.e. such module
type checks just fine. So it seems we're hitting some MyPy bug here, but I cannot say if it should fail, in a controlled way, in both cases, or rather pass both. I'll try to investigate this further, when I have some time to spare. Though I guess it would be nice to wrap it up for now, especially because we're dealing with incorrect annotation. I guess we can drop the protocol for now, i.e.
It is a bit more restrictive than it suppose to, but it is almost as expressive as the other one. What do you think? |
What would you think of instead keeping the slightly more permission version of eeb854b? |
To be honest I am not convinced. When in doubt I have strong preference towards false positive (type checker error, when the code is valid) over false negative (type checker pass, when code is invalid). The rationale is simple here:
On a side I personally consider annotations as tool to hint what is intended (contract, over details of implementation) and what is good practice ("one-- and preferably only one --obvious way to do it"). Furthermore, due to Python's dynamism, it is often impossible to provide exhaustive annotations, so some false positives are simply to be expected. |
Merge changes from #139 and patch to avoid mypy RecursionError
Sure, thanks a lot for all the time you put into this project! |
Fixes the binary math functions:
atan2
andhypot
take two arguments, not onepow
supports taking a literal numeric value as its second argument in addition to a Column.