Conditional expression produces different result than if (w/ callable()) #8265
Labels
bug
mypy got something wrong
priority-2-low
topic-ternary-expression
a if b else c
topic-type-narrowing
Conditional type narrowing / binder
I saw a bunch of different bugs and chatter for both conditional expressions and but I'm unsure if this behavior is reported on any of them. Apologies if this is noise.
This is with mypy 0.761 (with no arguments) on Python 3.7.3, inline:
So it seems the behavior differs on whether the if is inline, which I found really surprising.
[Separately, setting
foo
to0
also fails -- but on both of those cases, which I suppose would be a limitation, rather than a bug]The text was updated successfully, but these errors were encountered: