Skip to content

Wrong output for combined expressions #982

@4atj

Description

@4atj

I have observed a bug in mypyc. The following code produces different output in mypyc compared to regular Python.
This code should output: 0. However, in mypyc, it outputs: True.

print(((1 == 0) or 0) and True)
# Edit: (1 == 0) is not related to this issue.
# I think this is a better minimal example.
b = False
print((b or 0) and True)

mypy version: 1.2.0+dev.4365dad81a248f336ee1126acbe7f8692791ca3b
Cpython version: 3.11.0

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