@@ -1935,38 +1935,35 @@ P = ParamSpec("P")
1935
1935
class Foo(Generic[P]): ...
1936
1936
class Bar(Generic[P]): ...
1937
1937
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
1940
1940
1941
- def bad2 (foo1: Foo[[int, str ]], foo2: Foo[[int, bytes ]]) -> bool:
1941
+ def good1 (foo1: Foo[[int]], foo2: Foo[[str ]]) -> bool:
1942
1942
return foo1 == foo2
1943
1943
1944
- def bad3 (foo1: Foo[[int]], foo2: Foo[[int, int ]]) -> bool:
1944
+ def good2 (foo1: Foo[[int, str ]], foo2: Foo[[int, bytes ]]) -> bool:
1945
1945
return foo1 == foo2
1946
1946
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
1949
1949
1950
- def good1 (foo1: Foo[[int]], foo2: Foo[[int]]) -> bool:
1950
+ def good4 (foo1: Foo[[int]], foo2: Foo[[int]]) -> bool:
1951
1951
return foo1 == foo2
1952
1952
1953
- def good2 (foo1: Foo[[int]], foo2: Foo[[bool]]) -> bool:
1953
+ def good5 (foo1: Foo[[int]], foo2: Foo[[bool]]) -> bool:
1954
1954
return foo1 == foo2
1955
1955
1956
- def good3 (foo1: Foo[[int, int]], foo2: Foo[[bool, bool]]) -> bool:
1956
+ def good6 (foo1: Foo[[int, int]], foo2: Foo[[bool, bool]]) -> bool:
1957
1957
return foo1 == foo2
1958
1958
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:
1960
1960
return foo1 == foo2
1961
1961
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:
1963
1963
return foo1 == foo2
1964
1964
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:
1966
1966
return foo1 == foo2
1967
1967
1968
1968
[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