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
from functools import wraps
from typing import Any, AsyncIterator, Awaitable, Callable, Coroutine, Optional, TypeVar, Union, overload
from aiohttp import web
_T = TypeVar("_T")
_RequestView = TypeVar("_RequestView", web.Request, web.View)
def atomic(coro: Callable[[_RequestView], Awaitable[_T]]):
@wraps(coro)
async def wrapper(request_or_view: _RequestView) -> _T:
reveal_type(request_or_view)
if isinstance(request_or_view, web.View):
request = request_or_view.request
else:
request = request_or_view
I get an unreachable error on the last line. I suspect it is type checking twice with the TypeVar set to web.Request and then to web.View, which is resulting in an unreachable error. Rather odd that it doesn't produce a second unreachable error though...
The text was updated successfully, but these errors were encountered:
With:
I get an unreachable error on the last line. I suspect it is type checking twice with the TypeVar set to
web.Request
and then toweb.View
, which is resulting in an unreachable error. Rather odd that it doesn't produce a second unreachable error though...The text was updated successfully, but these errors were encountered: