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
main.py:32: error: Argument 1 to "harf" has incompatible type "partial[I]"; expected "Callable[[int], int]" [arg-type]
main.py:32: note: "partial[I].__call__" has type "Callable[[VarArg(Any), KwArg(Any)], I]"
main.py:33: error: Argument 1 to "harf" has incompatible type "partial[T]"; expected "Callable[[int], int]" [arg-type]
main.py:33: note: "partial[T].__call__" has type "Callable[[VarArg(Any), KwArg(Any)], T]"
Those errors are for the two lines where partial is used on func2 and func2b, the ones which use a TypeVar. No error is reported when used with func3, which I believe is an equivalent function, only using overload instead of a TypeVar.
Bug Report
mypy
reports a (false) incompatible type error whenpartial
is used on functions withTypeVar
s.To Reproduce
https://mypy-play.net/?mypy=latest&python=3.13&flags=verbose&gist=b65b8dade3556b815d146c8e8ff95427
Expected Behavior
I do not expect any errors to be reported.
Actual Behavior
Those errors are for the two lines where
partial
is used onfunc2
andfunc2b
, the ones which use aTypeVar
. No error is reported when used withfunc3
, which I believe is an equivalent function, only usingoverload
instead of aTypeVar
.This looks like it may be related to #15215
Your Environment
mypy.ini
(and other config files): NoneThe text was updated successfully, but these errors were encountered: