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
Please provide more information to help us understand the issue:
Are you reporting a bug, or opening a feature request?
Bug.
Please insert below the code you are checking with mypy,
or a mock-up repro if the source is private. We would appreciate
if you try to simplify your case to a minimal repro.
fromtypingimportAny, Callable, TypeVar_FirstDecoratee=TypeVar("_FirstDecoratee", bound=Callable[..., Any])
_SecondDecoratee=TypeVar("_SecondDecoratee", bound=Callable[..., Any])
defbasic_decorator(decoratee: _FirstDecoratee) ->_FirstDecoratee:
"decorate a function"returndecorateedefdecorator_transformer(
decorator: Callable[[_SecondDecoratee], _SecondDecoratee]
) ->Callable[[_SecondDecoratee], _SecondDecoratee]:
"take a decorator and return a version of it with the same signature"defmodified_decorator(decoratee: _SecondDecoratee) ->_SecondDecoratee:
returndecorateereturnmodified_decorator@basic_decoratordefunstacked() ->None:
"no decorator stack: no error"@decorator_transformer(basic_decorator)defstacked() ->None:
"decorator stack: this should be the same, but it's an error"
What is the actual behavior/output?
t.py:26: error: Argument 1 has incompatible type "Callable[[], None]"; expected "_FirstDecoratee"
What is the behavior/output you expect?
No error.
What are the versions of mypy and Python you are using?
mypy 0.782
Python 3.8.5
Do you see the same issue after installing mypy from Git master?
Is this a duplicate of #3924 ? Or the issue Jukka alluded to in #8978 (comment), "a known very old bug that generic functions when passed as arguments to another generic functions don't work"?
Please provide more information to help us understand the issue:
Bug.
or a mock-up repro if the source is private. We would appreciate
if you try to simplify your case to a minimal repro.
No error.
mypy 0.782
Python 3.8.5
Yes (0.790+dev.ffd9d1cdff4af3b482d4dd1f871fd1dc5b39eebb)
The text was updated successfully, but these errors were encountered: