async with
has a different interface from AsyncContextManager
?
#2487
Answered
by
decorator-factory
decorator-factory
asked this question in
Q&A
-
I'm not sure whether the issue is with from typing import Any, AsyncContextManager
from aiohttp import ClientSession
async def f():
async with ClientSession() as session:
print(session)
async def g():
ctx: AsyncContextManager[Any] = ClientSession()
async with ctx as session:
print(session)
mypy doesn't report any errors |
Beta Was this translation helpful? Give feedback.
Answered by
decorator-factory
Oct 25, 2021
Replies: 1 comment
-
sorry, looks like it's an issue in typeshed after all - also fixed in the latest version of pyright |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
decorator-factory
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sorry, looks like it's an issue in typeshed after all - also fixed in the latest version of pyright