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
importtyping_extensionsastT=t.TypeVar("T")
deco: t.Callable[[t.Callable[..., T]], t.Callable[..., T]]
@deco# mypy: Argument 1 has incompatible type "Callable[[T], T | int]"; expected "Callable[..., Never]" [arg-type]deffunc(item: T, /) ->T|int:
return0
The discovery of this was with @deco as @functools.singledispatch, which has signature def singledispatch(func: Callable[..., _T]) -> _SingleDispatchCallable[_T]: ....
Expected Behavior
No issues (as with mypy 1.6.1 without --new-type-inference and 1.7 with --old-type-inference)
Your Environment
Mypy version used: 1.6.1 with --new-type-inference, 1.7, master,
Mypy command-line flags: None
Mypy configuration options from mypy.ini (and other config files): None
Python version used: 3.10, 3.11
The text was updated successfully, but these errors were encountered:
Bug Report
The new type inference introduced (default in mypy 1.7) causes the following failure:
To Reproduce & Actual Behaviour
mypy-play.net
The discovery of this was with
@deco
as@functools.singledispatch
, which has signaturedef singledispatch(func: Callable[..., _T]) -> _SingleDispatchCallable[_T]: ...
.Expected Behavior
No issues (as with mypy 1.6.1 without
--new-type-inference
and 1.7 with--old-type-inference
)Your Environment
1.6.1
with--new-type-inference
,1.7
,master
,mypy.ini
(and other config files): None3.10
,3.11
The text was updated successfully, but these errors were encountered: