-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
bugmypy got something wrongmypy got something wrong
Description
Bug Report
We get an Any warning in 1.10:
aiojobs/aiohttp.py:50:5: error: Type of decorated function contains type "Any"
("_Wrapped[[_RequestView], Coroutine[object, object, _T], [_RequestView], Coroutine[Any, Any, _T]]")
[misc]
async def wrapper(request_or_view: _RequestView) -> _T:
^
It appears to me the problem is that the return type is inferred as Coroutine[Any, Any, _T]. Can't mypy infer this as Coroutine[None, None, _T] or atleast Coroutine[object, object, _T]?
To Reproduce
The code is:
def atomic(
coro: Callable[[_RequestView], Coroutine[object, object, _T]]
) -> Callable[[_RequestView], Awaitable[_T]]:
@wraps(coro)
async def wrapper(request_or_view: _RequestView) -> _T:
mtvx and jgillard
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrong