You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If cond: Bool, a: A, and b: B, then mypy thinks (cond and a) or b has type Union[bool, A, B]. But in fact the type should just be Union[A, B]. The only way (cond and a) or b can be a bool is for it to be (cond and a), and for that to be truth-y; but in that case (cond and a) would have type A, and never type bool (from cond).
The text was updated successfully, but these errors were encountered:
If
cond: Bool
,a: A
, andb: B
, then mypy thinks(cond and a) or b
has typeUnion[bool, A, B]
. But in fact the type should just beUnion[A, B]
. The only way(cond and a) or b
can be abool
is for it to be(cond and a)
, and for that to be truth-y; but in that case(cond and a)
would have typeA
, and never typebool
(fromcond
).The text was updated successfully, but these errors were encountered: