Skip to content

Fix unification of [0] if ... else [0.0] #1409

@gvanrossum

Description

@gvanrossum

This is a follow-up on #1094. The fix for that issue (#1403) was originally intended to also fix the problem with [0] if ... else [0.0], which still gives an error; but I don't think it's actually that common (certainly not as common as the case where one of the branches is empty), and it's somewhat tricky to do the right thing.

FWIW repro:

[0] if False else [0.0]

The error is:

<string>:1: error: List item 0 has incompatible type "float"

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions