-
-
Couldn't load subscription status.
- Fork 2.1k
Open
Labels
Description
Is your feature request related to a problem?
Typing application-level resource init & cleanup contexts with contextlib.asynccontextmanager makes them unusable as aiohttp's cleanup contexts, though the concept is same.
Describe the solution you'd like
Currently cleanup contexts are expected to be async generators, which should have only one yield.
Since it's been a long time after addition of contextlib.asynccontextmanager in the stdlib, I think it should accept them in addition to single-yielding async generators.
Describe alternatives you've considered
Completely changing cleanup contexts from async generators to async context managers would make it incompatible with existing codes, so we need to make it accept both.
Related component
Server
Additional context
No response
Code of Conduct
- I agree to follow the aio-libs Code of Conduct