Skip to content

Commit 0b7abe9

Browse files
committed
remove eq
1 parent 176c97a commit 0b7abe9

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

mypy/checker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8925,7 +8925,6 @@ def reduce_and_conditional_type_maps(ms: list[TypeMap], *, use_meet: bool) -> Ty
89258925

89268926

89278927
BUILTINS_CUSTOM_EQ_CHECKS: Final = {
8928-
"builtins.frozenset",
89298928
"_collections_abc.dict_keys",
89308929
"_collections_abc.dict_items",
89318930
}

test-data/unit/pythoneval.test

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2214,6 +2214,7 @@ reveal_type(d1 | d2)
22142214
_testDictOrUnionEdgeCases.py:10: note: Revealed type is "dict[str, dict[str, ... | int] | int]"
22152215

22162216
[case testNarrowingMappingAndAbstractSet]
2217+
# flags: --strict-equality --warn-unreachable
22172218
from typing import Mapping, AbstractSet
22182219

22192220
def f1(x: Mapping[str, int]) -> None:
@@ -2229,8 +2230,15 @@ def f2(x: AbstractSet[int]) -> None:
22292230

22302231
if x == set():
22312232
reveal_type(x)
2232-
[out]
2233-
_testNarrowingMappingAndAbstractSet.py:5: note: Revealed type is "dict[Any, Any]"
2234-
_testNarrowingMappingAndAbstractSet.py:8: note: Revealed type is "typing.Mapping[str, int]"
2235-
_testNarrowingMappingAndAbstractSet.py:12: note: Revealed type is "set[Any]"
2236-
_testNarrowingMappingAndAbstractSet.py:15: note: Revealed type is "typing.AbstractSet[int]"
2233+
2234+
def f3(x: frozenset[str], y: set[str]):
2235+
if x == y:
2236+
reveal_type(x)
2237+
reveal_type(y)
2238+
[out]
2239+
_testNarrowingMappingAndAbstractSet.py:6: note: Revealed type is "dict[Any, Any]"
2240+
_testNarrowingMappingAndAbstractSet.py:9: note: Revealed type is "typing.Mapping[str, int]"
2241+
_testNarrowingMappingAndAbstractSet.py:13: note: Revealed type is "set[Any]"
2242+
_testNarrowingMappingAndAbstractSet.py:16: note: Revealed type is "typing.AbstractSet[int]"
2243+
_testNarrowingMappingAndAbstractSet.py:20: note: Revealed type is "frozenset[str]"
2244+
_testNarrowingMappingAndAbstractSet.py:21: note: Revealed type is "set[str]"

0 commit comments

Comments
 (0)