[docs] [issue30831] Inconsistent or wrong documentation around Asynchronous Context Manager

Yury Selivanov report at bugs.python.org
Thu Mar 7 15:42:44 EST 2019


Yury Selivanov <yselivanov at gmail.com> added the comment:

There's no inconsistency here and the docs are correct.

If you have a function:

  async def foo():
    pass

Then "foo()" call returns a "coroutine", which is an awaitable.  So

  async def __aenter__():
    ...

always returns an awaitable (regardless if there's a return statement or not).


> On the other hand, actual CPython implementation won't do that; it won't await the returned objects.

If always does await the returned object.

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue30831>
_______________________________________


More information about the docs mailing list