Skip to content

Unreachable generator expressions fails to compile #816

@JukkaL

Description

@JukkaL

This fails to compile:

import sys
C = sys.platform == 'x' and (x for y in z)

There is a commented-out test in https://github.com/python/mypy/pull/10228/files#diff-456dccabc6ffa642d1668b9bcb96cf3aece3d132d4d7e64f66ee84b1783ad8f8R1070.

python/mypy#10228 fixed some issues with unreachable expressions, but not this one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions