You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
qc: Callable[..., bool] = partial(generic, resulting_type=str) # E: Incompatible types in assignment (expression has type "partial[str]", variable has type "Callable[..., bool]") \
389
-
# N: "partial[str].__call__" has type "Callable[[VarArg(Any), KwArg(Any)], str]"
388
+
qc: Callable[..., bool] = partial(generic, resulting_type=str) # E: Incompatible types in assignment (expression has type "partial[str]", variable has type "(..., bool)") \
389
+
# N: "partial[str].__call__" has type "(Any, Any) -> str"
a1, (a2, b) = A(), f # E: "Callable[[], None]" object is not iterable
412
+
a1, (a2, b) = A(), f # E: "() -> None" object is not iterable
413
413
a3, (c, d) = A(), A() # E: "A" object is not iterable
414
414
class A: pass
415
415
[builtins fixtures/for.pyi]
@@ -988,7 +988,7 @@ a = k2
988
988
if int():
989
989
a = k2
990
990
if int():
991
-
a = k1 # E: Incompatible types in assignment (expression has type "Callable[[int, List[T@k1]], List[Union[T@k1, int]]]", variable has type "Callable[[S, List[T@k2]], List[Union[T@k2, int]]]")
991
+
a = k1 # E: Incompatible types in assignment (expression has type "(int, List[T@k1]) -> List[Union[T@k1, int]]", variable has type "(S, List[T@k2]) -> List[Union[T@k2, int]]")
list_1 = [f, g] # E: List item 0 has incompatible type "Callable[[NamedArg(int, 'x')], int]"; expected "Callable[[NamedArg(int, 'y')], int]"
1112
+
list_1 = [f, g] # E: List item 0 has incompatible type "(x: int) -> int"; expected "(y: int) -> int"
1113
1113
list_2 = [f, h]
1114
1114
[builtins fixtures/list.pyi]
1115
1115
@@ -1390,14 +1390,14 @@ from typing import List, Callable
1390
1390
li = [1]
1391
1391
l = lambda: li
1392
1392
f1 = l # type: Callable[[], List[int]]
1393
-
f2 = l # type: Callable[[], List[str]] # E: Incompatible types in assignment (expression has type "Callable[[], List[int]]", variable has type "Callable[[], List[str]]")
1393
+
f2 = l # type: Callable[[], List[str]] # E: Incompatible types in assignment (expression has type "() -> List[int]", variable has type "() -> List[str]")
1394
1394
[builtins fixtures/list.pyi]
1395
1395
1396
1396
[case testInferLambdaType2]
1397
1397
from typing import List, Callable
1398
1398
l = lambda: [B()]
1399
1399
f1 = l # type: Callable[[], List[B]]
1400
-
f2 = l # type: Callable[[], List[A]] # E: Incompatible types in assignment (expression has type "Callable[[], List[B]]", variable has type "Callable[[], List[A]]")
1400
+
f2 = l # type: Callable[[], List[A]] # E: Incompatible types in assignment (expression has type "() -> List[B]", variable has type "() -> List[A]")
def g(a: Callable[..., None] = lambda *a, **k: 1): # E: Incompatible default for argument "a" (default has type "Callable[[VarArg(Any), KwArg(Any)], int]", argument has type "Callable[..., None]")
1438
+
def g(a: Callable[..., None] = lambda *a, **k: 1): # E: Incompatible default for argument "a" (default has type "(Any, Any) -> int", argument has type "(..., None)")
Copy file name to clipboardExpand all lines: test-data/unit/check-namedtuple.test
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -549,7 +549,7 @@ b = B._make(['']) # type: B
549
549
[case testNamedTupleIncompatibleRedefinition]
550
550
from typing import NamedTuple
551
551
class Crash(NamedTuple):
552
-
count: int # E: Incompatible types in assignment (expression has type "int", base class "tuple" defined the type as "Callable[[Tuple[int, ...], object], int]")
552
+
count: int # E: Incompatible types in assignment (expression has type "int", base class "tuple" defined the type as "(Tuple[int, ...], object) -> int")
a.py:3: error: Argument 1 to "dec" has incompatible type "Callable[[B], int]"; expected "Callable[[C], int]"
2483
+
a.py:3: error: Argument 1 to "dec" has incompatible type "(B) -> int"; expected "(C) -> int"
2484
2484
2485
2485
[case testOverloadRefresh]
2486
2486
from typing import overload
@@ -4514,9 +4514,9 @@ x = 0
4514
4514
x = ''
4515
4515
[builtins fixtures/tuple.pyi]
4516
4516
[out]
4517
-
b.py:5: error: Incompatible types in assignment (expression has type "int", base class "tuple" defined the type as "Callable[[Tuple[int, ...], object], int]")
4517
+
b.py:5: error: Incompatible types in assignment (expression has type "int", base class "tuple" defined the type as "(Tuple[int, ...], object) -> int")
4518
4518
==
4519
-
b.py:5: error: Incompatible types in assignment (expression has type "int", base class "tuple" defined the type as "Callable[[Tuple[int, ...], object], int]")
4519
+
b.py:5: error: Incompatible types in assignment (expression has type "int", base class "tuple" defined the type as "(Tuple[int, ...], object) -> int")
4520
4520
4521
4521
[case testReprocessEllipses1]
4522
4522
import a
@@ -6161,7 +6161,7 @@ class C:
6161
6161
pass
6162
6162
[out]
6163
6163
==
6164
-
a.py:6: error: Argument 1 to "func" has incompatible type "Type[C]"; expected "Callable[[int], Any]"
6164
+
a.py:6: error: Argument 1 to "func" has incompatible type "Type[C]"; expected "(int) -> Any"
6165
6165
6166
6166
[case testDunderNewDefine]
6167
6167
import a
@@ -8094,7 +8094,7 @@ def A(x: str) -> str: pass
8094
8094
[builtins fixtures/list.pyi]
8095
8095
[out]
8096
8096
==
8097
-
a.py:4: error: Incompatible import of "A" (imported name has type "Callable[[str], str]", local name has type "Type[List[Any]]")
8097
+
a.py:4: error: Incompatible import of "A" (imported name has type "(str) -> str", local name has type "Type[List[Any]]")
Copy file name to clipboardExpand all lines: test-data/unit/pythoneval-asyncio.test
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -364,7 +364,7 @@ try:
364
364
finally:
365
365
loop.close()
366
366
[out]
367
-
_program.py:17: error: Argument 1 to "add_done_callback" of "Future" has incompatible type "Callable[[Future[int]], None]"; expected "Callable[[Future[str]], object]"
367
+
_program.py:17: error: Argument 1 to "add_done_callback" of "Future" has incompatible type "(Future[int]) -> None"; expected "(Future[str]) -> object"
0 commit comments