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
Mypy appears to lose type information simply by using a TypeAlias with generics. I'm trying to define a re-usable type for Decorator throughout my codebase so that I don't have to recreate Callable[[Callable[P, A]], Callable[P, A]] and can instead just use Decorator[P, A]. However, when I do this the type is silently replaced with Never.
I expect mypy to to reveal that x has a type of Revealed type is "def (i: builtins.int) -> builtins.int". This is what I get when I do not use the TypeAlias for Decorator
Actual Behavior
Instead I get that Revealed type is "def (*Never, **Never) -> Never".
Your Environment
Mypy version used: 1.7.0
Mypy command-line flags:
Mypy configuration options from mypy.ini (and other config files):
Python version used: 3.9
The text was updated successfully, but these errors were encountered:
Bug Report
Mypy appears to lose type information simply by using a TypeAlias with generics. I'm trying to define a re-usable type for
Decorator
throughout my codebase so that I don't have to recreateCallable[[Callable[P, A]], Callable[P, A]]
and can instead just useDecorator[P, A]
. However, when I do this the type is silently replaced with Never.To Reproduce
Expected Behavior
I expect mypy to to reveal that
x
has a type ofRevealed type is "def (i: builtins.int) -> builtins.int"
. This is what I get when I do not use theTypeAlias
for DecoratorActual Behavior
Instead I get that
Revealed type is "def (*Never, **Never) -> Never"
.Your Environment
mypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: