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]") \
362
+
# N: "partial[str].__call__" has type "Callable[[VarArg(Any), KwArg(Any)], str]"
363
+
[builtins fixtures/tuple.pyi]
364
+
365
+
[case testFunctoolsPartialNestedPartial]
366
+
from functools import partial
367
+
from typing import Any
368
+
369
+
def foo(x: int) -> int: ...
370
+
p = partial(partial, foo)
371
+
reveal_type(p()(1)) # N: Revealed type is "builtins.int"
372
+
p()("no") # E: Argument 1 to "foo" has incompatible type "str"; expected "int"
373
+
374
+
q = partial(partial, partial, foo)
375
+
q()()("no") # E: Argument 1 to "foo" has incompatible type "str"; expected "int"
376
+
377
+
r = partial(partial, foo, 1)
378
+
reveal_type(r()()) # N: Revealed type is "builtins.int"
0 commit comments