Re: Await expressions

Liste des GroupesRevenir à cl python 
Sujet : Re: Await expressions
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.lang.python
Date : 01. Feb 2024, 11:09:10
Autres entêtes
Organisation : Stefan Ram
Message-ID : <await-20240201110402@ram.dialup.fu-berlin.de>
References : 1
ram@zedat.fu-berlin.de (Stefan Ram) writes:
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

  A wording I like is what I found in the World-Wide Web where
  Victor Skvortsov wrote:

|When we await on some object, await first checks whether the
|object is a native coroutine or a generator-based coroutine,
|in which case it "yields from" the coroutine. Otherwise, it
|"yields from" the iterator returned by the object's
|__await__() method.
Victor Skvortsov (2021).

  This actually explains "to wait on some object" (which might be the
  same as to "suspend on some object"), and I was not able to find
  such an explanation in the venerable Python Language Reference!

  Heck, even of the respected members of this newsgroup, IIRC, no one
  mentioned "__await__". So, let's give a big shoutout to Victor!


Date Sujet#  Auteur
26 Jan 24 * Await expressions9Stefan Ram
26 Jan 24 +* Re: Await expressions (Posting On Python-List Prohibited)3Stefan Ram
28 Jan 24 i`* Re: Await expressions2Stefan Ram
29 Jan 24 i `- Re: Await expressions1Stefan Ram
31 Jan 24 +- Re: Await expressions1Stefan Ram
1 Feb 24 `* Re: Await expressions4Stefan Ram
1 Feb 24  `* Re: Await expressions3Stefan Ram
1 Feb 24   `* Re: Await expressions2Stefan Ram
2 Feb 24    `- Re: Await expressions1Stefan Ram

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal