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
fromtypingimportNamedTuple, Literal, List, TupleC=NamedTuple("C", [("x", Literal[True, False])])
T=Tuple[Literal[True, False]]
# Incompatible types in assignment (expression has type "List[C]", variable has type "List[C]")x: List[C] = [C(True)]
t: T# Incompatible types in assignment (expression has type "List[Tuple[bool]]", # variable has type "List[Tuple[Union[Literal[True], Literal[False]]]]")y: List[T] = [t]
In some places in our code bool was compared with `Union[Literal[True], Literal[False]]`.
It was later compared with each union item. And bool is not subtype of
`Literal[True]` and `Literal[False]`.
Closes#11701
Refs #11705
…ython#11709)
In some places in our code bool was compared with `Union[Literal[True], Literal[False]]`.
It was later compared with each union item. And bool is not subtype of
`Literal[True]` and `Literal[False]`.
Closespython#11701
Refs python#11705
This code generates unexpected errors:
The issue was introduced in #10389.
Marking as high priority since this is a regression.
cc @ethan-leba
The text was updated successfully, but these errors were encountered: