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
{{ message }}
Repository navigation
Constrain/narrow literal type with 'in' checks #9718
error: Incompatible types in assignment (expression has type "Union[Literal[1], Literal[2], Literal[3]]", variable has
type "Union[Literal[1], Literal[2]]")
b: Literal[1, 2] = a
^
Activity
prayatharth commentedon Nov 13, 2020
What problem exactly we are facing here ?
JelleZijlstra commentedon Nov 13, 2020
The report seems clear enough to me. It's a reasonable request; a PR would be welcome.
hauntsaninja commentedon Nov 12, 2023
Duplicate of #12535
Literalusinginsyntax #12535