Type of conditional expression is object when using Protocol #11722
Labels
bug
mypy got something wrong
topic-join-v-union
Using join vs. using unions
topic-ternary-expression
a if b else c
Mypy does not infer that a conditional expression returns a Protocol. Here is the code:
Error message:
But if I change it to an conditional statement it works perfectly:
The text was updated successfully, but these errors were encountered: