Skip to content

Strict equality false positive with lists having different item types #14511

@JukkaL

Description

@JukkaL

This generate a false positive when using --strict-equality:

class C: pass
class D:
    def __eq__(self, other): return True

a = [C()]
b = [D()]
C() == D()  # No error
print(a == b)  # error: Non-overlapping equality check (left operand type: "List[C]", right operand type: "List[D]")

Metadata

Metadata

Assignees

Labels

bugmypy got something wrong

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions