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
Passing a callable to another which matches the typevar with another typevar doesn't allow passing them into the return type. (if that makes no sense, the reproducer below is simple)
To Reproduce
fromtypingimportGeneric, TypeVar, CallableT=TypeVar("T")
V=TypeVar("V")
classX(Generic[T]):
deff(self: X[Callable[[V], None]]) ->Callable[[V], V]:
definner_f(v: V) ->V:
returnvreturninner_freveal_type(X[Callable[[T], None]]().f()) # N: Revealed type is "def (Never) -> Never"# ^ this should keep the generic
Expected Behavior
I don't expect a Never.
Your Environment
Checked on mypy playground.
Mypy version used: v1.14
Mypy command-line flags: --strict
Mypy configuration options from mypy.ini (and other config files): N/A
Python version used: 3.12
The text was updated successfully, but these errors were encountered:
Bug Report
Passing a callable to another which matches the typevar with another typevar doesn't allow passing them into the return type. (if that makes no sense, the reproducer below is simple)
To Reproduce
Expected Behavior
I don't expect a
Never
.Your Environment
Checked on mypy playground.
--strict
mypy.ini
(and other config files): N/AThe text was updated successfully, but these errors were encountered: