Teks sumber — English
Terjemahan — Bahasa Indonesia
An :term:`awaitable` object generally implements an :meth:`~object.__await__` method. :term:`Coroutine objects <coroutine>` returned from :keyword:`async def` functions are awaitable.
Coroutine Objects
Objek Coroutine
:term:`Coroutine objects <coroutine>` are :term:`awaitable` objects. A coroutine's execution can be controlled by calling :meth:`~object.__await__` and iterating over the result. When the coroutine has finished executing and returns, the iterator raises :exc:`StopIteration`, and the exception's :attr:`~StopIteration.value` attribute holds the return value. If the coroutine raises an exception, it is propagated by the iterator. Coroutines should not directly raise unhandled :exc:`StopIteration` exceptions.
Coroutine objects are automatically closed using the above process when they are about to be destroyed.