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
When calling functools.update_wrapper(f, g) where f has a type of TypeVar('T', Type1, Type2), mypy errors incorrectly, saying it expects Callable[[Never], Never] in that spot.
I think f1 and f2 are identical functions. I expect both checks to succeed (as they did on mypy 1.9.0), or possibly both to fail (but if this is an error, I don't see why...).
Actual Behavior
update_wrapper(f1, g) succeeds and update_wrapper(f2, g) errors, with the message Argument 1 to "update_wrapper" has incompatible type "Callable[[T], T]"; expected "Callable[[Never], Never]" [arg-type]
Your Environment
Mypy version used: 1.9.0 -> 1.10.0
Python version used: 3.10, 3.12
The text was updated successfully, but these errors were encountered:
Bug Report
When calling
functools.update_wrapper(f, g)
wheref
has a type ofTypeVar('T', Type1, Type2)
, mypy errors incorrectly, saying it expectsCallable[[Never], Never]
in that spot.To Reproduce
https://mypy-play.net/?mypy=latest&python=3.12&gist=8b79db2fe7eb042e15122536a393dd43
Expected Behavior
I think
f1
andf2
are identical functions. I expect both checks to succeed (as they did on mypy 1.9.0), or possibly both to fail (but if this is an error, I don't see why...).Actual Behavior
update_wrapper(f1, g)
succeeds andupdate_wrapper(f2, g)
errors, with the messageArgument 1 to "update_wrapper" has incompatible type "Callable[[T], T]"; expected "Callable[[Never], Never]" [arg-type]
Your Environment
The text was updated successfully, but these errors were encountered: