Skip to content

bool/float treated inconsistently with bool/int and int/float, causing inconsistent Union simplification #1850

Closed
@ajprax

Description

@ajprax

l = [] # type: List[Union[bool, int, float]]
causes "error: Incompatible types in assignment (expression has type List[float], variable has type List[Union[bool, int, float]])"

I also tried

l1 = [] # type: List[Union[bool, int]]
l2 = [] # type: List[Union[bool, float]]
l3 = [] # type: List[Union[int, float]]
x = True # type: Union[bool, int, float]

and they all pass.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions