@@ -1935,38 +1935,35 @@ P = ParamSpec("P")
19351935class Foo(Generic[P]): ...
19361936class Bar(Generic[P]): ...
19371937
1938- def bad1(foo1 : Foo[[int]], foo2: Foo[[str ]]) -> bool:
1939- return foo1 == foo2
1938+ def bad(foo : Foo[[int]], bar: Bar[[int ]]) -> bool:
1939+ return foo == bar
19401940
1941- def bad2 (foo1: Foo[[int, str ]], foo2: Foo[[int, bytes ]]) -> bool:
1941+ def good1 (foo1: Foo[[int]], foo2: Foo[[str ]]) -> bool:
19421942 return foo1 == foo2
19431943
1944- def bad3 (foo1: Foo[[int]], foo2: Foo[[int, int ]]) -> bool:
1944+ def good2 (foo1: Foo[[int, str ]], foo2: Foo[[int, bytes ]]) -> bool:
19451945 return foo1 == foo2
19461946
1947- def bad4(foo : Foo[[int]], bar: Bar[[ int]]) -> bool:
1948- return foo == bar
1947+ def good3(foo1 : Foo[[int]], foo2: Foo[[int, int]]) -> bool:
1948+ return foo1 == foo2
19491949
1950- def good1 (foo1: Foo[[int]], foo2: Foo[[int]]) -> bool:
1950+ def good4 (foo1: Foo[[int]], foo2: Foo[[int]]) -> bool:
19511951 return foo1 == foo2
19521952
1953- def good2 (foo1: Foo[[int]], foo2: Foo[[bool]]) -> bool:
1953+ def good5 (foo1: Foo[[int]], foo2: Foo[[bool]]) -> bool:
19541954 return foo1 == foo2
19551955
1956- def good3 (foo1: Foo[[int, int]], foo2: Foo[[bool, bool]]) -> bool:
1956+ def good6 (foo1: Foo[[int, int]], foo2: Foo[[bool, bool]]) -> bool:
19571957 return foo1 == foo2
19581958
1959- def good4 (foo1: Foo[[int]], foo2: Foo[P], *args: P.args, **kwargs: P.kwargs) -> bool:
1959+ def good7 (foo1: Foo[[int]], foo2: Foo[P], *args: P.args, **kwargs: P.kwargs) -> bool:
19601960 return foo1 == foo2
19611961
1962- def good5 (foo1: Foo[P], foo2: Foo[[int, str, bytes]], *args: P.args, **kwargs: P.kwargs) -> bool:
1962+ def good8 (foo1: Foo[P], foo2: Foo[[int, str, bytes]], *args: P.args, **kwargs: P.kwargs) -> bool:
19631963 return foo1 == foo2
19641964
1965- def good6 (foo1: Foo[Concatenate[int, P]], foo2: Foo[[int, str, bytes]], *args: P.args, **kwargs: P.kwargs) -> bool:
1965+ def good9 (foo1: Foo[Concatenate[int, P]], foo2: Foo[[int, str, bytes]], *args: P.args, **kwargs: P.kwargs) -> bool:
19661966 return foo1 == foo2
19671967
19681968[out]
1969- _testStrictEqualitywithParamSpec.py:11: error: Non-overlapping equality check (left operand type: "Foo[[int]]", right operand type: "Foo[[str]]")
1970- _testStrictEqualitywithParamSpec.py:14: error: Non-overlapping equality check (left operand type: "Foo[[int, str]]", right operand type: "Foo[[int, bytes]]")
1971- _testStrictEqualitywithParamSpec.py:17: error: Non-overlapping equality check (left operand type: "Foo[[int]]", right operand type: "Foo[[int, int]]")
1972- _testStrictEqualitywithParamSpec.py:20: error: Non-overlapping equality check (left operand type: "Foo[[int]]", right operand type: "Bar[[int]]")
1969+ _testStrictEqualitywithParamSpec.py:11: error: Non-overlapping equality check (left operand type: "Foo[[int]]", right operand type: "Bar[[int]]")
0 commit comments