-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed as not planned
Labels
featurepriority-1-normaltopic-literal-typestopic-type-narrowingConditional type narrowing / binderConditional type narrowing / binder
Description
from typing import Literal
a: Literal[1, 2, 3] = 2
assert a in (1, 2)
b: Literal[1, 2] = a
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
^
huonw, intgr, IvarVirusiim and bluenote10
Metadata
Metadata
Assignees
Labels
featurepriority-1-normaltopic-literal-typestopic-type-narrowingConditional type narrowing / binderConditional type narrowing / binder