Mailing List Archive

Re: Await expressions
We say that an object is an awaitable object if it can be used in an
await expression. Many asyncio APIs are designed to accept awaitables.

There are three main types of awaitable objects:
coroutines, Tasks, and Futures.

Stefan Ram schrieb:
> In "The Python Language Reference, Release 3.13.0a0",
> there is this section:
>
> |6.4 Await expression
> |
> |Suspend the execution of coroutine on an awaitable object.
> |Can only be used inside a coroutine function.
> |
> |await_expr ::= "await" primary
> |
> |New in version 3.5.
>
> . And this is the whole section.
>
> What I do not understand:
>
> - Which coroutine is suspended?
> - Which object is the object mentioned?
> - For what purpose is the value of the primary expression used?
> - What does it mean to "suspend something on something"?
>

--
https://mail.python.org/mailman/listinfo/python-list
Re: Await expressions [ In reply to ]
Maybe consult:

PEP 492 – Coroutines with async and await syntax
Created: 09-Apr-2015
Python-Version: 3.5
https://peps.python.org/pep-0492/

Mild Shock schrieb:
>
> We say that an object is an awaitable object if it can be used in an
> await expression. Many asyncio APIs are designed to accept awaitables.
>
> There are three main types of awaitable objects:
> coroutines, Tasks, and Futures.
>
> Stefan Ram schrieb:
>>    In "The Python Language Reference, Release 3.13.0a0",
>>    there is this section:
>>
>> |6.4 Await expression
>> |
>> |Suspend the execution of coroutine on an awaitable object.
>> |Can only be used inside a coroutine function.
>> |
>> |await_expr ::= "await" primary
>> |
>> |New in version 3.5.
>>
>>    . And this is the whole section.
>>
>>    What I do not understand:
>>
>>    - Which coroutine is suspended?
>>    - Which object is the object mentioned?
>>    - For what purpose is the value of the primary expression used?
>>    - What does it mean to "suspend something on something"?
>>
>

--
https://mail.python.org/mailman/listinfo/python-list