python-trio / trio-typing

Type hints for Trio and related projects
Other
27 stars 14 forks source link

async_generator.aclosing() should accept async generators #40

Closed oremanj closed 2 years ago

oremanj commented 2 years ago

Currently it doesn't because typing.AsyncGenerator is typed with def aclose(self) -> Awaitable[None]: while we're trying to match against a protocol with async def aclose(self) -> None:. async def implies a return type of Coroutine which native async generator aclose() doesn't provide (it returns a different sort of awaitable).