Skip to content

Unexpected error comparing set and frozenset for equality with --strict-equality #7275

@neiljp

Description

@neiljp

I just upgraded a local mypy installation to 0.720 (python 3.6.5) and was exploring --strict-equality.

My interpretation is that sets and frozensets can be compared just fine; as such the following error was rather unexpected:

$mypy --strict-equality /tmp/blah.py
blah.py:3: error: Non-overlapping equality check (left operand type: "FrozenSet[int]", right operand type: "Set[int]")

for

# blah.py
x = frozenset([1,2,3])
y = set([1,2,3])
if x == y:
    print("equal")

As expected, python3 blah.py gives equal.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions