Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"I'm a mean green mother from outer space" -- Audrey II, The Little Shop of Horrors


devel / comp.lang.python / Await expressions

SubjectAuthor
* Await expressionsStefan Ram
+* Re: Await expressionsMild Shock
|`- Re: Await expressionsMild Shock
+* Re: Await expressions (Posting On Python-List Prohibited)Lawrence D'Oliveiro
|`* Re: Await expressions (Posting On Python-List Prohibited)Stefan Ram
| +- Re: Await expressions (Posting On Python-List Prohibited)Lawrence D'Oliveiro
| `* Re: Await expressions (Posting On Python-List Prohibited)Greg Ewing
|  +- Re: Await expressions (Posting On Python-List Prohibited)Chris Angelico
|  +* Re: Await expressions (Posting On Python-List Prohibited)dieter.maurer
|  |`* Re: Await expressionsStefan Ram
|  | `* Re: Await expressions (Posting On Python-List Prohibited)Lawrence D'Oliveiro
|  |  `* Re: Await expressionsStefan Ram
|  |   `- Re: Await expressions (Posting On Python-List Prohibited)Lawrence D'Oliveiro
|  `- Re: Await expressions (Posting On Python-List Prohibited)Lawrence D'Oliveiro
+* Re: Await expressionsStefan Ram
|`- Re: Await expressions (Posting On Python-List Prohibited)Lawrence D'Oliveiro
`* Re: Await expressionsStefan Ram
 +* Re: Await expressionsStefan Ram
 |`* Re: Await expressionsStefan Ram
 | `* Re: Await expressionsStefan Ram
 |  `* Re: Await expressions (Posting On Python-List Prohibited)Lawrence D'Oliveiro
 |   `* Re: Await expressions (Posting On Python-List Prohibited)Mild Shock
 |    +- Re: Await expressions (Posting On Python-List Prohibited)Mild Shock
 |    `* Re: Await expressions (Posting On Python-List Prohibited)Lawrence D'Oliveiro
 |     `* Re: Await expressions (Posting On Python-List Prohibited)Mild Shock
 |      `- Re: Await expressions (Posting On Python-List Prohibited)Mild Shock
 `* Re: Await expressions (Posting On Python-List Prohibited)Lawrence D'Oliveiro
  `- Re: Await expressions (Posting On Python-List Prohibited)Jon Ribbens

Pages:12
Await expressions

<await-20240126193156@ram.dialup.fu-berlin.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24936&group=comp.lang.python#24936

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.niel.me!news.gegeweb.eu!gegeweb.org!news.mb-net.net!open-news-network.org!news.mind.de!bolzen.all.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Await expressions
Date: 26 Jan 2024 18:36:50 GMT
Organization: Stefan Ram
Lines: 21
Expires: 1 Dec 2024 11:59:58 GMT
Message-ID: <await-20240126193156@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de V4WUdw4ER1HxEkvgcV3dswviJiJfd9xKPYn0zR0DYnveO/
Cancel-Lock: sha1:CeZIaEwOzaotWQotnzIcae9mnBI= sha256:Z9c8qWrU4KpU9u8jTs3/EOWBoFZ//SuKVmzNOhJhOT8=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR
 by: Stefan Ram - Fri, 26 Jan 2024 18:36 UTC

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"?

Re: Await expressions

<up13g0$v8cp$2@solani.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24937&group=comp.lang.python#24937

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.chmurka.net!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janbu...@fastmail.fm (Mild Shock)
Newsgroups: comp.lang.python
Subject: Re: Await expressions
Date: Fri, 26 Jan 2024 21:08:33 +0100
Message-ID: <up13g0$v8cp$2@solani.org>
References: <await-20240126193156@ram.dialup.fu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 26 Jan 2024 20:08:32 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1024409"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.18.1
Cancel-Lock: sha1:2NQSPPRnGfMB4fHFdi8WDeDCIRM=
In-Reply-To: <await-20240126193156@ram.dialup.fu-berlin.de>
X-User-ID: eJwNytEVADEEBMCWBLtoJ0T/Jdy9+R0YDzucoGOxlX1lxkRiztYT4+/KIfD+FV6ag33omaybE3B20dRVJT45gxRZ
 by: Mild Shock - Fri, 26 Jan 2024 20:08 UTC

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"?
>

Re: Await expressions

<up13qh$v8m3$1@solani.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24938&group=comp.lang.python#24938

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!rocksolid2!news.neodome.net!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janbu...@fastmail.fm (Mild Shock)
Newsgroups: comp.lang.python
Subject: Re: Await expressions
Date: Fri, 26 Jan 2024 21:14:09 +0100
Message-ID: <up13qh$v8m3$1@solani.org>
References: <await-20240126193156@ram.dialup.fu-berlin.de>
<up13g0$v8cp$2@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 26 Jan 2024 20:14:09 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1024707"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.18.1
Cancel-Lock: sha1:yC0DnOJzsrMBb0+pBZoraZdeIkI=
In-Reply-To: <up13g0$v8cp$2@solani.org>
X-User-ID: eJwNy8kBwCAIBMCWlmOJlgMi/ZcQH/McWkicz4PhHM7NOoCb1oPAOtltmxfZylyoSdeuTRPDsOFAv+k3ZVF/U2AVLg==
 by: Mild Shock - Fri, 26 Jan 2024 20:14 UTC

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"?
>>
>

Re: Await expressions (Posting On Python-List Prohibited)

<up16lv$313qt$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24940&group=comp.lang.python#24940

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.python
Subject: Re: Await expressions (Posting On Python-List Prohibited)
Date: Fri, 26 Jan 2024 21:02:55 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <up16lv$313qt$1@dont-email.me>
References: <await-20240126193156@ram.dialup.fu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 26 Jan 2024 21:02:55 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e3e30b5c11bd53f646c3b65395233311";
logging-data="3182429"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18tlFYin9lBkCNW2817d8bj"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:DkOOw/0bo4JM/itxBsD9af4HJ/8=
 by: Lawrence D'Oliv - Fri, 26 Jan 2024 21:02 UTC

On 26 Jan 2024 18:36:50 GMT, Stefan Ram wrote:

> 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?

The one currently executing. An “await” expression is only allowed at
the top level of an “async def” function.

> - Which object is the object mentioned?

The result returned from the primary.

> - For what purpose is the value of the primary expression used?

To return the awaitable object.

> - What does it mean to "suspend something on something"?

It returns control to the point of execution of the .send method that
(directly or indirectly) started or resumed the coroutine execution.

I did a diagram that gives an overview of the whole system of
interlocking concepts here
<https://www.deviantart.com/default-cube/art/Van-Rossum-s-Triangle-679791228>.

Re: Await expressions (Posting On Python-List Prohibited)

<specification-20240126223958@ram.dialup.fu-berlin.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24941&group=comp.lang.python#24941

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: Await expressions (Posting On Python-List Prohibited)
Date: 26 Jan 2024 21:46:47 GMT
Organization: Stefan Ram
Lines: 26
Expires: 1 Dec 2024 11:59:58 GMT
Message-ID: <specification-20240126223958@ram.dialup.fu-berlin.de>
References: <await-20240126193156@ram.dialup.fu-berlin.de> <up16lv$313qt$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de B1FdWp+kuU0eqQ4f4uaXBQoa+Kh445OO77rAlpO+7MvQOG
Cancel-Lock: sha1:761skRci7FQDcJKPhalZyeD2Muk= sha256:KHERMsq516mJQqxxDihz+3VTtyqDbBcNDCAZDB/nk7M=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR
 by: Stefan Ram - Fri, 26 Jan 2024 21:46 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>On 26 Jan 2024 18:36:50 GMT, Stefan Ram wrote:
>>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 |
....
>>- What does it mean to "suspend something on something"?
>It returns control to the point of execution of the .send method that
>(directly or indirectly) started or resumed the coroutine execution.

Thank you!

The specification said: "suspend the execution of coroutine on
an awaitable object".

You said this: "returns control to the point of execution of the
.send method that (directly or indirectly) started or resumed
the coroutine execution.".

But your explanation seems to have no mention of the "something" /
"the awaitable object" part following the preposition "on". Shouldn't
this awaitable object play a rôle in the explanation of what happens?

Re: Await expressions (Posting On Python-List Prohibited)

<up1gnn$32k8k$5@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24942&group=comp.lang.python#24942

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.python
Subject: Re: Await expressions (Posting On Python-List Prohibited)
Date: Fri, 26 Jan 2024 23:54:31 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <up1gnn$32k8k$5@dont-email.me>
References: <await-20240126193156@ram.dialup.fu-berlin.de>
<up16lv$313qt$1@dont-email.me>
<specification-20240126223958@ram.dialup.fu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 26 Jan 2024 23:54:31 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="558b003fc8e02bc378c971d6b5ee8a6a";
logging-data="3232020"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX196GpFiMzfKMJmyAxJFljLc"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:3eCPesOR2lskwMkB1otlbqftPGI=
 by: Lawrence D'Oliv - Fri, 26 Jan 2024 23:54 UTC

On 26 Jan 2024 21:46:47 GMT, Stefan Ram wrote:

> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>
>>> - Which object is the object mentioned?
>>
>>The result returned from the primary.
>>
>>> - For what purpose is the value of the primary expression used?
>>
>>To return the awaitable object.
>
> But your explanation seems to have no mention of the "something" /
> "the awaitable object" part following the preposition "on". Shouldn't
> this awaitable object play a rôle in the explanation of what happens?

See above.

Re: Await expressions (Posting On Python-List Prohibited)

<l1ivbdFovj6U1@mid.individual.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24943&group=comp.lang.python#24943

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: greg.ew...@canterbury.ac.nz (Greg Ewing)
Newsgroups: comp.lang.python
Subject: Re: Await expressions (Posting On Python-List Prohibited)
Date: Sat, 27 Jan 2024 12:59:39 +1300
Lines: 13
Message-ID: <l1ivbdFovj6U1@mid.individual.net>
References: <await-20240126193156@ram.dialup.fu-berlin.de>
<up16lv$313qt$1@dont-email.me>
<specification-20240126223958@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net PIGWcgpTCXss30QS2D+s7A54wEJru/Yn9FVA5kQxf5ynt267EN
Cancel-Lock: sha1:hmazoO1lKeuqGzMpNCijaykwsE0= sha256:srxr/hmjHrArQ+rEFv7OqF8Bqd6qxhgZExc5c0+3u3w=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:91.0)
Gecko/20100101 Thunderbird/91.3.2
Content-Language: en-US
In-Reply-To: <specification-20240126223958@ram.dialup.fu-berlin.de>
 by: Greg Ewing - Fri, 26 Jan 2024 23:59 UTC

On 27/01/24 10:46 am, Stefan Ram wrote:
> But your explanation seems to have no mention of the "something" /
> "the awaitable object" part following the preposition "on". Shouldn't
> this awaitable object play a rôle in the explanation of what happens?

If it helps at all, you can think of an async function as being
very similar to a generator, and "await" as being very similar to
"yield from". In the current implementation they're almost exactly
the same thing underneath.

--
Greg

Re: Await expressions (Posting On Python-List Prohibited)

<mailman.0.1706313902.3227.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24944&group=comp.lang.python#24944

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!usenet.network!news.neodome.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: ros...@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: Await expressions (Posting On Python-List Prohibited)
Date: Sat, 27 Jan 2024 11:04:48 +1100
Lines: 13
Message-ID: <mailman.0.1706313902.3227.python-list@python.org>
References: <await-20240126193156@ram.dialup.fu-berlin.de>
<up16lv$313qt$1@dont-email.me>
<specification-20240126223958@ram.dialup.fu-berlin.de>
<l1ivbdFovj6U1@mid.individual.net>
<CAPTjJmqcgf166WmFKG4_QYFON4cFep-hAGdnAj87wSV4CkCXSQ@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de JiDul8v1cin/4mrhI5vLjgBEhu75UrhY7xFYr9Kv3eBw==
Cancel-Lock: sha1:U2/9WA5NhAV1hacSlWSTUOChZtk= sha256:ueQlPWPd1WprOqAXSmIBwnIfw3LOba8CWnZUzeQO0sY=
Return-Path: <rosuav@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=Zc5lQtj9;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.079
X-Spam-Evidence: '*H*': 0.84; '*S*': 0.00; 'responses': 0.09;
'subject:Python': 0.12; '2024': 0.16; 'chrisa': 0.16;
'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16;
'greg': 0.16; 'wrote:': 0.16; 'to:addr:python-list': 0.20; 'all,':
0.20; 'sat,': 0.22; 'function': 0.27; 'think': 0.32; 'python-
list': 0.32; 'message-id:@mail.gmail.com': 0.32; 'same': 0.34;
'header:In-Reply-To:1': 0.34; 'received:google.com': 0.34;
'from:addr:gmail.com': 0.35; 'people': 0.36; 'want': 0.40;
'helps': 0.60; 'public': 0.63; 'similar': 0.65; 'exactly': 0.68;
'received:mail-lj1-x22d.google.com': 0.69; 'responding': 0.69;
'subject:List': 0.71; 'subject:Posting': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1706313900; x=1706918700; darn=python.org;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:from:to:cc:subject:date:message-id:reply-to;
bh=YV9tiqqWPcLhTVa5lnev0bH6JSA7pfwuuQVwTAT/P1Y=;
b=Zc5lQtj9P7bb7KBG+OEUOPW2fKJKAl/TyWwrm1oSE2cZ6oR/sum6r3QH1nH+fpK7H+
2XCz0h0a3OpZeSqDzwtFd2c9BCnO5MsphS1QvaUtKHpb7v+EQrUk3Mg8falSGtu21y/U
MYyfSLfGSc1xMSzCP4/gZSGkL9AAMx/8xpufMq124o91oa2+Mj2pn5KTPDhnqw06Zkmy
XeYdSXq2mHPtkpae6sZXhrYfaHye7YoyUYW+b2oFwdmARJjBZXu2/SmqQlOHYOnb33TB
qwSWXnAR5EV3uo/Vd/DDSRfGERmgd5wCeh5YL7MxlcDIx/rjZSajhW2jNegeqVtrjtxt
AzMQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1706313900; x=1706918700;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
bh=YV9tiqqWPcLhTVa5lnev0bH6JSA7pfwuuQVwTAT/P1Y=;
b=e1VFZaT530ewbZeZ8ENgMzUs8mnUzT3Iw/Nh6yuyf3HnLIhyTLhM1HHL3PmYjenw+g
uxszZLtJUrO0Js8w6NHG+UFuuj4MwoQttZttwTuRptKQ4KoLo/IT5eNpCLl9UkCBjxSR
O49DixfIBMtH3aeTKSBReRFYSBa/k2mXO4hjJCA34NiGXVhtFDF0PDgwDjtQFL4fK+Ou
Ve1Zv4ypY/P3uyZLXg3yB7JCG1XxFQ4Lqh5uDwVBLQfGDpUCHidgbu4fI5E/M6AaxcSF
AQBnijHBgm0QdGzMhW7eWdk9jqi123Mm4gMF6CBJ5lhzKOHGQw19rNXG/pmuShZvqN0V
bF/w==
X-Gm-Message-State: AOJu0YxU8PkoKAzL9NCKOcBmlQtVL4l/tPMvQkPtM7ylbHFx5iOlusa4
qCdI8dHxFphhUekfcwK49qas0Jx1s0V2NvncnAhP11n+W5MqmyKGe5zAdR5yrxVpttfCjLzCVkn
uRSulI+uIT48lgEjaUXQb6gSNkthAKSpQ
X-Google-Smtp-Source: AGHT+IHoERPSUpLhgyr11yv4JHCp6mlPF8k+gK+75jgAqhVauYRkz6uwbtMuJOc/so7txgRsRiHURJg0hzF2fH5ZBLY=
X-Received: by 2002:a2e:8ec1:0:b0:2cd:f7b3:5218 with SMTP id
e1-20020a2e8ec1000000b002cdf7b35218mr333964ljl.35.1706313899679; Fri, 26 Jan
2024 16:04:59 -0800 (PST)
In-Reply-To: <l1ivbdFovj6U1@mid.individual.net>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAPTjJmqcgf166WmFKG4_QYFON4cFep-hAGdnAj87wSV4CkCXSQ@mail.gmail.com>
X-Mailman-Original-References: <await-20240126193156@ram.dialup.fu-berlin.de>
<up16lv$313qt$1@dont-email.me>
<specification-20240126223958@ram.dialup.fu-berlin.de>
<l1ivbdFovj6U1@mid.individual.net>
 by: Chris Angelico - Sat, 27 Jan 2024 00:04 UTC

On Sat, 27 Jan 2024 at 11:01, Greg Ewing via Python-list
<python-list@python.org> wrote:
>
> If it helps at all, you can think of an async function as being
> very similar to a generator, and "await" as being very similar to
> "yield from". In the current implementation they're almost exactly
> the same thing underneath.
>

Don't bother responding to people who say that they don't want
responses on a public list.

ChrisA

Re: Await expressions (Posting On Python-List Prohibited)

<mailman.1.1706378304.3227.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24945&group=comp.lang.python#24945

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.neodome.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: dieter.m...@online.de
Newsgroups: comp.lang.python
Subject: Re: Await expressions (Posting On Python-List Prohibited)
Date: Sat, 27 Jan 2024 18:33:29 +0100
Lines: 21
Message-ID: <mailman.1.1706378304.3227.python-list@python.org>
References: <await-20240126193156@ram.dialup.fu-berlin.de>
<up16lv$313qt$1@dont-email.me>
<specification-20240126223958@ram.dialup.fu-berlin.de>
<l1ivbdFovj6U1@mid.individual.net>
<26037.15977.126265.855727@ixdm.fritz.box>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de 6W5ivc8Pn7SFmCNOPMs25g6nun781mr03gI8Dl4om1/g==
Cancel-Lock: sha1:bp6izJnmD0WMXfX3yN5QDzCjcwY= sha256:2plP1bQfkywaG2VdwL+CVWS2p2x6zpL499/YirYn5Zs=
Return-Path: <dieter.maurer@online.de>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.014
X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'e.g.': 0.07;
'explanation': 0.07; 'ram': 0.07; 'cc:addr:python-list': 0.09;
"shouldn't": 0.09; 'skip:` 10': 0.09; 'subject:Python': 0.12;
'cc:no real name:2**0': 0.14; 'meanwhile': 0.16; 'provisions':
0.16; 'received:217.72.192.75': 0.16; 'wrote:': 0.16;
'cc:addr:python.org': 0.20; 'returns': 0.22; 'received:de': 0.23;
'(and': 0.25; 'saying': 0.25; 'cc:2**0': 0.25; 'seems': 0.26;
'object': 0.26; 'stefan': 0.26; 'function': 0.27; 'am,': 0.31;
'received:kundenserver.de': 0.32; 'received:mout.kundenserver.de':
0.32; 'but': 0.32; 'able': 0.34; 'header:In-Reply-To:1': 0.34;
'"the': 0.35; 'following': 0.35; 'special': 0.37;
'received:192.168': 0.37; 'necessary': 0.39; 'explain': 0.40;
'everything': 0.63; 'your': 0.64; 'received:217': 0.67;
'subject:List': 0.71; 'charset:iso-8859-1': 0.73; 'produces':
0.76; 'happens': 0.84; 'eventually': 0.84; 'subject:Posting': 0.84
In-Reply-To: <l1ivbdFovj6U1@mid.individual.net>
X-Mailer: VM 8.0.12-devo-585 under 21.4 (patch 24) "Standard C" XEmacs Lucid
(x86_64-linux-gnu)
X-Provags-ID: V03:K1:02bTWtAI19qXY3rWoEb1UBicKJQ4ruIEJd0w7kIolpbdUdS16hd
Kwq/3ergmCnffIyWXKPGTnF6q1kbXvCXyULB0v0ygrAy+y4uLJAOxTsUlLqRwOKer16xqx+
XdY6uMxfC+7Ol9nlPfuKy7XrhYi0akgDedSU+fKYjcYfrpqUjuNN1QrR0C/kJ5dWmrNDG6s
VY76F6fJXWG9saCVFtPFg==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:ArhpLqvLpu8=;Noef6BITN8B/pWrHEoMLFKhUUUv
mBonWxFtbeosaF4qseaarFhIxHtFmPt1zyEDMcsMuKBdt3dTCS3FHrUD900dIBYHVySAPOgZ6
R2IjoGoHJhq6wd5uwD/biV1Hd7kdsk+bmJNqu3eQGQmPyYfcWWMy+flL4LTZb2Aqi5alBH1uN
EPAHG3maWFN1cgFu2CUSblMPkHl3WTszWlvQAW1rIgpfLWDSchG0sVqDYi3eoZH6D9wvuCSNK
muWqtmS65jJfUqrgkaAdIfMDZHFascTVFC6J/BqTkOxC/O2Yli7Scvx4LGxlctkpLjbdlQjWH
N/r6Imu5RoJOrK02+S0HDxFYjuxv+ewOEIHReFdXMc4qH7rEUD3UkgBpbWmoOVYdQcMm+DLj8
GIY4upw8OyJUOP0FhF4kyniWU5jnZNT/MNQI1va8K6+SnduaE/fYkVGlRlGPGA0jZ0eIf9rPj
8VnvCGqltuoBVbvis/Zo70XEsRDoc+XVGCbMkcK+1Yu0edBgJdokcMTEXhHVQQtPgS3VfKDIK
qGufkEsFuXWaoRnIyXnTILvcamfMf8ofAXfq+BwV0AVs6jqR3cHRPfZ6XN/1JkRdHG2jKTELN
XEvh9AQsWTb1xeDqmIGG4N5GTUAjhocn0AUC/2Xo0aCQbafUViRKIx6AKZD4YGP0XFHqccJE9
iPp2Rcd7AEhV5cE0XqxSL1spwWx8x/Ubzc0iM9eVdRD3c3/9Q8N0EJaU8GDbb/CIDF4iJnXmS
EVMTnfZf1pToheJ7rsCYNCNy3bTtUUosCB7tBB8UGnRHS4vDi29VoUN+GE9qY6RUsw3P0CL3L
wmHJQ+kmRq+ZpGNRpBudrxwLNbcIaFcmm7J1o+ecovCNFfSaJhDryhE/muFiTltymKyqopYIN
GsJRcGBK+AIGx+x/NowX5SEmtaNx8VOWpDINLx15qww9lKgoKZEr48VoYX0Hozs61c93nmey/
23betg==
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <26037.15977.126265.855727@ixdm.fritz.box>
X-Mailman-Original-References: <await-20240126193156@ram.dialup.fu-berlin.de>
<up16lv$313qt$1@dont-email.me>
<specification-20240126223958@ram.dialup.fu-berlin.de>
<l1ivbdFovj6U1@mid.individual.net>
 by: dieter.m...@online.de - Sat, 27 Jan 2024 17:33 UTC

>On 27/01/24 10:46 am, Stefan Ram wrote:
>> But your explanation seems to have no mention of the "something" /
>> "the awaitable object" part following the preposition "on". Shouldn't
>> this awaitable object play a rôle in the explanation of what happens?

You can explain a function call without saying much about the called function.
Similarly, you can explain "await <expr>" without saying much about
"<expr>".

Important is only: "<expr>" evaluates to an "awaitable".
An "awaitable" (usually an `asyncio.Future`, `asyncio.Task` or
call of an `async` function) eventuelly produces
a value and `await <expr>` waits until
this happens and then returns this value.

Not everything which eventually returns a value is an
"awaitable" -- e.g. a call of `time.sleep` is not an "awaitable".
Special provisions are necessary to be able to wait for a value
(and meanwhile do other things).
`asyncio.sleep` has e.g. this provisions and a call of it is an "awaitable".

Re: Await expressions (Posting On Python-List Prohibited)

<up3pgj$3hbk7$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24946&group=comp.lang.python#24946

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.chmurka.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.python
Subject: Re: Await expressions (Posting On Python-List Prohibited)
Date: Sat, 27 Jan 2024 20:36:35 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <up3pgj$3hbk7$1@dont-email.me>
References: <await-20240126193156@ram.dialup.fu-berlin.de>
<up16lv$313qt$1@dont-email.me>
<specification-20240126223958@ram.dialup.fu-berlin.de>
<l1ivbdFovj6U1@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 27 Jan 2024 20:36:35 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a9befbf67dfd56f15a347bec2826e976";
logging-data="3714695"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19VJehu6LlK4fjZ8/0yjAIm"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:/KwqIwRo7EhDn6EXX1tPcvzDuTM=
 by: Lawrence D'Oliv - Sat, 27 Jan 2024 20:36 UTC

On Sat, 27 Jan 2024 12:59:39 +1300, Greg Ewing wrote:

> If it helps at all, you can think of an async function as being very
> similar to a generator, and "await" as being very similar to "yield
> from". In the current implementation they're almost exactly the same
> thing underneath.

Similar, yet not quite the same; in no sense can one stand in for the
other.

Re: Await expressions

<expr-20240128155450@ram.dialup.fu-berlin.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24947&group=comp.lang.python#24947

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.neodome.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: Await expressions
Date: 28 Jan 2024 15:09:12 GMT
Organization: Stefan Ram
Lines: 43
Expires: 1 Dec 2024 11:59:58 GMT
Message-ID: <expr-20240128155450@ram.dialup.fu-berlin.de>
References: <await-20240126193156@ram.dialup.fu-berlin.de> <up16lv$313qt$1@dont-email.me> <specification-20240126223958@ram.dialup.fu-berlin.de> <l1ivbdFovj6U1@mid.individual.net> <26037.15977.126265.855727@ixdm.fritz.box> <mailman.1.1706378304.3227.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de EFpKu7eZFEeYohvSJ2X3RwiBs5eOEfsG7G9Uf9iOuGCX4I
Cancel-Lock: sha1:0rtdt6dsHWf+BhlphgIAYqLPXyg= sha256:nTtM/M7f+SY9YT/fNbzk+qHQk9ySmzIHhfVWqS83mkE=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR
 by: Stefan Ram - Sun, 28 Jan 2024 15:09 UTC

dieter.maurer@online.de writes:
>You can explain a function call without saying much about the called function.
>Similarly, you can explain "await <expr>" without saying much about
>"<expr>".

Thanks, Greg and Dieter! The intention of my post was twofold:
To better understand "await", but also to suggest that the
documentation can be improved.

When I have a syntax section and then a semantics section,
the syntax introduces terms that can then be referred to
in the semantics section.

For example:

| Syntax:
| |expression + expression
| | Semantic
| |Evaluates to the sum of the values of the two expressions.

This is clear to me. Notice how "expressions" in the Semantics
section refers to the two "expression" in the Syntax section.
What would be less clear:

| Syntax:
| |expression + expression
| | Semantic
| |Evaluates to the sum of two numbers.

What "two numbers"? Yes, now we can guess that these numbers must
be the values of the expressions, but it's less clear.

I think that the author of the specification could improve
the specification by addressing my questions from the OP,
but I am not able to submit a suggestion for a wording myself,
because I am still learning asyncio.

Re: Await expressions (Posting On Python-List Prohibited)

<up6f6i$2vq9$12@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24950&group=comp.lang.python#24950

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.python
Subject: Re: Await expressions (Posting On Python-List Prohibited)
Date: Sun, 28 Jan 2024 20:58:58 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <up6f6i$2vq9$12@dont-email.me>
References: <await-20240126193156@ram.dialup.fu-berlin.de>
<up16lv$313qt$1@dont-email.me>
<specification-20240126223958@ram.dialup.fu-berlin.de>
<l1ivbdFovj6U1@mid.individual.net>
<26037.15977.126265.855727@ixdm.fritz.box>
<mailman.1.1706378304.3227.python-list@python.org>
<expr-20240128155450@ram.dialup.fu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 28 Jan 2024 20:58:58 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="aa3bd129a7fc4eefdc68e712f3fbcc7a";
logging-data="98121"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19RYDd2ERWePuE1FQI8mmRN"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:FsscC99BuXGDhFCJKpWbfTqss3M=
 by: Lawrence D'Oliv - Sun, 28 Jan 2024 20:58 UTC

On 28 Jan 2024 15:09:12 GMT, Stefan Ram wrote:

> I think that the author of the specification could improve the
> specification by addressing my questions from the OP,
> but I am not able to submit a suggestion for a wording myself, because I
> am still learning asyncio.

It can be a tricky thing to get to grips with, particularly if you are
trying to understand how it works at a low level. That’s why I put
together my “Python Topics Notebooks” series of Jupyter notebooks
<https://gitlab.com/ldo/python_topics_notebooks/>.

The one on “Generators & Coroutines” takes you through some stuff you
might already know about (generators), then goes on from there into
coroutines, the send() method and awaitables, and the basics of
implementing your own asyncio-style event loop.

Re: Await expressions

<asyncio-20240129134136@ram.dialup.fu-berlin.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24951&group=comp.lang.python#24951

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.samoylyk.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: Await expressions
Date: 29 Jan 2024 12:53:33 GMT
Organization: Stefan Ram
Lines: 61
Expires: 1 Dec 2024 11:59:58 GMT
Message-ID: <asyncio-20240129134136@ram.dialup.fu-berlin.de>
References: <await-20240126193156@ram.dialup.fu-berlin.de> <up16lv$313qt$1@dont-email.me> <specification-20240126223958@ram.dialup.fu-berlin.de> <l1ivbdFovj6U1@mid.individual.net> <26037.15977.126265.855727@ixdm.fritz.box> <mailman.1.1706378304.3227.python-list@python.org> <expr-20240128155450@ram.dialup.fu-berlin.de> <up6f6i$2vq9$12@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de AbLmi47cvnDFBfYZKif3mwIjeR6JCIHORay7pziSzUWT4c
Cancel-Lock: sha1:7Ujxj4+Sna2lT81Sa7WkpEx8QTc= sha256:BSbyFeMUtUx9calNNOm4MvTp3pdqY4j7L9TWDIrey5I=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR
 by: Stefan Ram - Mon, 29 Jan 2024 12:53 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>It can be a tricky thing to get to grips with, particularly if you are
>trying to understand how it works at a low level.

Does "await f()" (immediately) call "f()"?

To find this out, I wrote the following program.

I assume that the next function executed after executing
"await sleep()" is "sleep" and encoded this in assertions.
So far, this assumption never failed.

So, directly after the eternal task executes "await sleep()",
it is always the coroutine sleep() that starts, it never
happens that the other task continues before this happens.

Also, "caller" in "sleep" is "main", "eternal", or "other" as if
"sleep" is called from one of those (as one would naïvely expect).

So, it seems that "await f()" indeed will call f().

import asyncio as _asyncio
import inspect as _inspect
import random as _random

next = ''

async def sleep():
global next
assert next == 'sleep'
next = ''
caller = ''
frameinfo = _inspect.stack( 1 )
if frameinfo: caller = frameinfo[ 1 ].function
await _asyncio.sleep( 0.0000000001 )

async def eternal():
global next
while True:
assert next != 'sleep'
next = 'sleep'
await sleep()

async def other():
global next
while True:
assert next != 'sleep'
next = 'sleep'
await sleep()

async def main():
global next
assert next != 'sleep'
eternal_task = _asyncio.get_running_loop().create_task( eternal() )
next = 'sleep'
await sleep()
other_task = _asyncio.get_running_loop().create_task( other() )
await eternal_task

_asyncio.run( main() )

Re: Await expressions (Posting On Python-List Prohibited)

<up9e5m$lmi3$6@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24965&group=comp.lang.python#24965

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.python
Subject: Re: Await expressions (Posting On Python-List Prohibited)
Date: Mon, 29 Jan 2024 23:59:50 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <up9e5m$lmi3$6@dont-email.me>
References: <await-20240126193156@ram.dialup.fu-berlin.de>
<up16lv$313qt$1@dont-email.me>
<specification-20240126223958@ram.dialup.fu-berlin.de>
<l1ivbdFovj6U1@mid.individual.net>
<26037.15977.126265.855727@ixdm.fritz.box>
<mailman.1.1706378304.3227.python-list@python.org>
<expr-20240128155450@ram.dialup.fu-berlin.de> <up6f6i$2vq9$12@dont-email.me>
<asyncio-20240129134136@ram.dialup.fu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 29 Jan 2024 23:59:50 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ba17ffef95be9ddc6f864a9afa7ca434";
logging-data="711235"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ikeD910rLYCSbMflAyk6c"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:U+KDIBYrJzfds5bITe1CEFpVCzs=
 by: Lawrence D'Oliv - Mon, 29 Jan 2024 23:59 UTC

On 29 Jan 2024 12:53:33 GMT, Stefan Ram wrote:

> Does "await f()" (immediately) call "f()"?

Of course. The expression is evaluated exactly as it would normally be in
any other context. The “await”-construct in which it occurs then does
something special with the returned value.

Re: Await expressions

<await-20240131154138@ram.dialup.fu-berlin.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24987&group=comp.lang.python#24987

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: Await expressions
Date: 31 Jan 2024 14:43:15 GMT
Organization: Stefan Ram
Lines: 58
Expires: 1 Dec 2024 11:59:58 GMT
Message-ID: <await-20240131154138@ram.dialup.fu-berlin.de>
References: <await-20240126193156@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de 5bdyNDt8tbwR7EMzTLN9AAnI8//rUG+1Il3uUVh1TVVObA
Cancel-Lock: sha1:np0YdD4VajliEvPVb7uis5AUE1M= sha256:mcvAqn6UICAy3f7SHNkyE2fvL0lTsxBsw2722BGY/BY=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR
 by: Stefan Ram - Wed, 31 Jan 2024 14:43 UTC

ram@zedat.fu-berlin.de (Stefan Ram) writes:
>|await_expr ::= "await" primary
>|Suspend the execution of coroutine on an awaitable object.

My ideas of language specifications are that they should
contain all the information to write an implementation of the
language. I am not sure whether the Python Language Reference
already fullfils this criterion. BUT I have made one step
in the direction of better understanding "await":

main.py

import dis

def f(): return g()

dis.dis( f )
print()

async def f(): return await g()

dis.dis( f )

sys.stdout

3 0 LOAD_GLOBAL 0 (g)
2 CALL_FUNCTION 0
4 RETURN_VALUE

8 0 LOAD_GLOBAL 0 (g)
2 CALL_FUNCTION 0
4 GET_AWAITABLE
6 LOAD_CONST 0 (None)
8 YIELD_FROM
10 RETURN_VALUE

. So, now it's down to finding documentation for the "GET_AWAITABLE"
and "YIELD_FROM" opcodes! One can guess that GET_AWAITABLE just gets
a kind of reference to the coroutine g. So the core of await must be
YIELD_FROM. Web:

|In Python 3.11 and above, the YIELD_FROM opcode is replaced
|by a SEND + YIELD_VALUE while loop, as documented in the
|SEND(target_delta).

. Oh, this seems to be a moving target!

|# yield from subgenerator is implemented as the following loop
|# (with None initially at the top of the stack)
|#
|# SEND (sends the top of stack to the subgenerator)
|# YIELD_VALUE (returns the yielded value to the caller)
|# JUMP_BACKWARDS (to SEND)

Ok, but this just seems to spell out what "YIELD_FROM" does,
so it should still be true that "await" boils down to "YIELD_FROM".
(Yes, Greg already kindly answered something to that effect.)

Re: Await expressions (Posting On Python-List Prohibited)

<upejrq$1nil8$4@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24991&group=comp.lang.python#24991

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.python
Subject: Re: Await expressions (Posting On Python-List Prohibited)
Date: Wed, 31 Jan 2024 23:07:38 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <upejrq$1nil8$4@dont-email.me>
References: <await-20240126193156@ram.dialup.fu-berlin.de>
<await-20240131154138@ram.dialup.fu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 31 Jan 2024 23:07:38 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="292505b1016833b26c02e42290db7d4f";
logging-data="1821352"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/QUA1HvI++WGoBfWEdrVyx"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:GlvTUIA1CbDoDty5nl1Pb+hl0p0=
 by: Lawrence D'Oliv - Wed, 31 Jan 2024 23:07 UTC

On 31 Jan 2024 14:43:15 GMT, Stefan Ram wrote:

> My ideas of language specifications are that they should contain all
> the information to write an implementation of the language. I am not
> sure whether the Python Language Reference already fullfils this
> criterion.

Why not ask the various developers of implementations the Python language?
There are quite a few different implementations around, and you can see
how successful they were at working from a common spec.

> def f(): return g()

> async def f(): return await g()

Assuming g() returns something awaitable, these two are logically
equivalent.

Re: Await expressions

<await-20240201110402@ram.dialup.fu-berlin.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24992&group=comp.lang.python#24992

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!rocksolid2!news.neodome.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: Await expressions
Date: 1 Feb 2024 10:09:10 GMT
Organization: Stefan Ram
Lines: 25
Expires: 1 Dec 2024 11:59:58 GMT
Message-ID: <await-20240201110402@ram.dialup.fu-berlin.de>
References: <await-20240126193156@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de Nfav8k7c2jAIfjpwZuHmCA4GyFIpE8pnuR+G9ZMb0A4Q5f
Cancel-Lock: sha1:jW3T6UMF7CGkm5mZWw9sQa1pqK0= sha256:PEH7Yp0Fe1gKHZdDhrYk2mThM4vN6fbyrxZ/uf/zZlI=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR
 by: Stefan Ram - Thu, 1 Feb 2024 10:09 UTC

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!

Re: Await expressions

<await-20240201173737@ram.dialup.fu-berlin.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24993&group=comp.lang.python#24993

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.samoylyk.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: Await expressions
Date: 1 Feb 2024 16:39:44 GMT
Organization: Stefan Ram
Lines: 39
Expires: 1 Dec 2024 11:59:58 GMT
Message-ID: <await-20240201173737@ram.dialup.fu-berlin.de>
References: <await-20240126193156@ram.dialup.fu-berlin.de> <await-20240201110402@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de xijdTxdrRNyOtAY9dxquiwkhOcolhBnM2AOgMDbOaCEYJj
Cancel-Lock: sha1:2AVXAwwlEYGpJf4SpWabwLpA6Zs= sha256:ueGJHlm4fl1Kx8qS1O9kWdOQNXWt9oH9efS3ga6ZLq8=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR
 by: Stefan Ram - Thu, 1 Feb 2024 16:39 UTC

ram@zedat.fu-berlin.de (Stefan Ram) writes:
>Heck, even of the respected members of this newsgroup, IIRC, no one
>mentioned "__await__". So, let's give a big shoutout to Victor!

It should be possible to understand "await" in isolation (in
the spirit of the quotation I posted to "comp.lang.lisp" today.)
For example, use "await" without using "asycnio". So here's
an example program in that direction I just wrote.

main.py

class o_class():
def __await__( self ):
print( "__await__ called." )
return iter( [ 'a', 'b', 'c' ])

o = o_class()

async def f():
while 1: await o

for i, j in enumerate( f().__await__() ):
print( j )
if 5 == i: break

sys.stdout

__await__ called.
a b
c __await__ called.
a b
c

(Then, it should also be interesting to understand how asyncio
uses "await" to implement asynchronous I/O.)

Re: Await expressions

<future-20240201182111@ram.dialup.fu-berlin.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24994&group=comp.lang.python#24994

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.bbs.nz!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: Await expressions
Date: 1 Feb 2024 17:32:58 GMT
Organization: Stefan Ram
Lines: 23
Expires: 1 Dec 2024 11:59:58 GMT
Message-ID: <future-20240201182111@ram.dialup.fu-berlin.de>
References: <await-20240126193156@ram.dialup.fu-berlin.de> <await-20240201110402@ram.dialup.fu-berlin.de> <await-20240201173737@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de UnF9Xz6Vf6jDqDa7VfP7twZqmhSIp93e9gAvOrrmme8Q0k
Cancel-Lock: sha1:siwRi0AL9c4byc/iu9NNDTm+XVs= sha256:5zC+/Y2PmOb/eVL1E1UfZq4m4EALLD+h2BWlV2M4pXI=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR
 by: Stefan Ram - Thu, 1 Feb 2024 17:32 UTC

ram@zedat.fu-berlin.de (Stefan Ram) writes:
>(Then, it should also be interesting to understand how asyncio
>uses "await" to implement asynchronous I/O.)

I have taken "sleep" from asyncio\tasks.py and simplified it a bit:

async def sleep( delay, result=None, *, loop=None ):

loop = events.get_running_loop()

future = loop.create_future()

h = loop.call_later
( delay, futures._set_result_unless_cancelled, future, result )

try: return await future
finally: h.cancel()

So, this is how the control is transferred to the event
loop after an "await sleep"! Initially, the control goes
to "sleep", but this transfers the control to the event loop
(until "sleep" stops waiting for its future in "await future").

Re: Await expressions (Posting On Python-List Prohibited)

<upherm$29ukk$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24995&group=comp.lang.python#24995

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.python
Subject: Re: Await expressions (Posting On Python-List Prohibited)
Date: Fri, 2 Feb 2024 01:00:38 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <upherm$29ukk$1@dont-email.me>
References: <await-20240126193156@ram.dialup.fu-berlin.de>
<await-20240201110402@ram.dialup.fu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 2 Feb 2024 01:00:38 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2132941f276938b37dd44911619c6d41";
logging-data="2423444"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19I4bGntgCPr9CFtD0nWcoP"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:0dtrO744hdeZ4VlN3TzQnEOo6Kg=
 by: Lawrence D'Oliv - Fri, 2 Feb 2024 01:00 UTC

On 1 Feb 2024 10:09:10 GMT, Stefan Ram wrote:

> Heck, even of the respected members of this newsgroup, IIRC, no one
> mentioned "__await__".

It’s part of the definition of an “awaitable”, if you had looked that up.

<https://docs.python.org/3/glossary.html#term-awaitable>

Re: Await expressions (Posting On Python-List Prohibited)

<slrnurohen.62k.jon+usenet@raven.unequivocal.eu>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24996&group=comp.lang.python#24996

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jon+use...@unequivocal.eu (Jon Ribbens)
Newsgroups: comp.lang.python
Subject: Re: Await expressions (Posting On Python-List Prohibited)
Date: Fri, 2 Feb 2024 01:31:03 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <slrnurohen.62k.jon+usenet@raven.unequivocal.eu>
References: <await-20240126193156@ram.dialup.fu-berlin.de>
<await-20240201110402@ram.dialup.fu-berlin.de>
<upherm$29ukk$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 2 Feb 2024 01:31:03 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="012c24f02755af1410aa23f4b3421942";
logging-data="2432722"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX185f4KJ8dDXHJZc3u2/lGhsrAbYUbwmyRY="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:wLtTvNBwoX2hnlZxkfzO4+rZiKQ=
 by: Jon Ribbens - Fri, 2 Feb 2024 01:31 UTC

On 2024-02-02, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
> On 1 Feb 2024 10:09:10 GMT, Stefan Ram wrote:
>
>> Heck, even of the respected members of this newsgroup, IIRC, no one
>> mentioned "__await__".
>
> It’s part of the definition of an “awaitable”, if you had looked that up.
>
><https://docs.python.org/3/glossary.html#term-awaitable>

To be fair, I've been using Python for well over quarter of a century,
and I never knew it had a glossary.

Re: Await expressions

<IO-20240202101058@ram.dialup.fu-berlin.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24997&group=comp.lang.python#24997

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.hispagatos.org!eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: Await expressions
Date: 2 Feb 2024 09:12:06 GMT
Organization: Stefan Ram
Lines: 23
Expires: 1 Dec 2024 11:59:58 GMT
Message-ID: <IO-20240202101058@ram.dialup.fu-berlin.de>
References: <await-20240126193156@ram.dialup.fu-berlin.de> <await-20240201110402@ram.dialup.fu-berlin.de> <await-20240201173737@ram.dialup.fu-berlin.de> <future-20240201182111@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de EiUcNKE/Trfhc358uUqFygJ9cJ1/IvT/r9ZEeyKanLzOxH
Cancel-Lock: sha1:3fIjurOlEcJ4E0fIz7VqQOWGoWo= sha256:jn5NqFPWJW3qmJsWu9wgR3Ih2twqtlJ7gWPz6Z4k7Nc=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR
 by: Stefan Ram - Fri, 2 Feb 2024 09:12 UTC

ram@zedat.fu-berlin.de (Stefan Ram) writes:
>So, this is how the control is transferred to the event
>loop after an "await sleep"! Initially, the control goes
>to "sleep", but this transfers the control to the event loop
>(until "sleep" stops waiting for its future in "await future").

And, to answer one final question, let me quote the Web again.
The author name is not indicated clearly, but probably it's "Bharel":

|The final burning question we must answer is - how is the IO
|implemented?
....
|The IO part of the event loop is built upon a single crucial
|function called "select".
....
|When all available tasks are waiting for futures, the event
|loop calls select and waits. When the one of the sockets has
|incoming data, or its send buffer drained up, asyncio checks
|for the future object tied to that socket, and sets it to
|done.
....
probably Bharel.

Re: Await expressions (Posting On Python-List Prohibited)

<upjn56$2oup9$8@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24998&group=comp.lang.python#24998

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.python
Subject: Re: Await expressions (Posting On Python-List Prohibited)
Date: Fri, 2 Feb 2024 21:34:30 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <upjn56$2oup9$8@dont-email.me>
References: <await-20240126193156@ram.dialup.fu-berlin.de>
<await-20240201110402@ram.dialup.fu-berlin.de>
<await-20240201173737@ram.dialup.fu-berlin.de>
<future-20240201182111@ram.dialup.fu-berlin.de>
<IO-20240202101058@ram.dialup.fu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 2 Feb 2024 21:34:30 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2132941f276938b37dd44911619c6d41";
logging-data="2915113"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+PZ/OVPB0EK3KqlsoeFDoF"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:fE8hth3YKFTu4RvFAclvKOWAmIU=
 by: Lawrence D'Oliv - Fri, 2 Feb 2024 21:34 UTC

On 2 Feb 2024 09:12:06 GMT, Stefan Ram wrote:

> |The IO part of the event loop is built upon a single crucial
> |function called "select".

select(2) has limitations. Better to use poll(2). Depending on *nix
variant, other more advanced alternatives may also be available
<https://docs.python.org/3/library/select.html>.

Re: Await expressions (Posting On Python-List Prohibited)

<upjuqe$1a18j$1@solani.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24999&group=comp.lang.python#24999

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!nntp.comgw.net!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janbu...@fastmail.fm (Mild Shock)
Newsgroups: comp.lang.python
Subject: Re: Await expressions (Posting On Python-List Prohibited)
Date: Sat, 3 Feb 2024 00:45:18 +0100
Message-ID: <upjuqe$1a18j$1@solani.org>
References: <await-20240126193156@ram.dialup.fu-berlin.de>
<await-20240201110402@ram.dialup.fu-berlin.de>
<await-20240201173737@ram.dialup.fu-berlin.de>
<future-20240201182111@ram.dialup.fu-berlin.de>
<IO-20240202101058@ram.dialup.fu-berlin.de> <upjn56$2oup9$8@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 2 Feb 2024 23:45:18 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1377555"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.18.1
Cancel-Lock: sha1:VyuRtcSlSlJUKYtlaVZWDVTtLXU=
X-User-ID: eJwNwoEVRDEEBMCWQliU4zb0X8K/eeMXAobBYb6+t+wI37RimjP2Eltv/iN3fknVK4fFFkZbZJroeUQ7uvgBe3sWWw==
In-Reply-To: <upjn56$2oup9$8@dont-email.me>
 by: Mild Shock - Fri, 2 Feb 2024 23:45 UTC

I am still waiting for async files in the
style of nodejs that works on windows and

is bundled with the main python distribution.
I am not very fond on doing something

like adding listeners to a file descriptor,
in nodejs async files are based on callbacks

not on listeners. Whats the roadmap here?

Lawrence D'Oliveiro schrieb:
> On 2 Feb 2024 09:12:06 GMT, Stefan Ram wrote:
>
>> |The IO part of the event loop is built upon a single crucial
>> |function called "select".
>
> select(2) has limitations. Better to use poll(2). Depending on *nix
> variant, other more advanced alternatives may also be available
> <https://docs.python.org/3/library/select.html>.
>

Re: Await expressions (Posting On Python-List Prohibited)

<upjv40$1a1a9$1@solani.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=25000&group=comp.lang.python#25000

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.samoylyk.net!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janbu...@fastmail.fm (Mild Shock)
Newsgroups: comp.lang.python
Subject: Re: Await expressions (Posting On Python-List Prohibited)
Date: Sat, 3 Feb 2024 00:50:25 +0100
Message-ID: <upjv40$1a1a9$1@solani.org>
References: <await-20240126193156@ram.dialup.fu-berlin.de>
<await-20240201110402@ram.dialup.fu-berlin.de>
<await-20240201173737@ram.dialup.fu-berlin.de>
<future-20240201182111@ram.dialup.fu-berlin.de>
<IO-20240202101058@ram.dialup.fu-berlin.de> <upjn56$2oup9$8@dont-email.me>
<upjuqe$1a18j$1@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 2 Feb 2024 23:50:24 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1377609"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.18.1
Cancel-Lock: sha1:0vxu8VtNtxLkzYlUjvLx3MqQ+88=
X-User-ID: eJwNy7EBACEIBLCVVDiEcTh49h/hLVMEYtvqqsEUg9EGye5OypgtqxEy20/opwH/MvY9Xgty8nntyldS6YHmD39tFk0=
In-Reply-To: <upjuqe$1a18j$1@solani.org>
 by: Mild Shock - Fri, 2 Feb 2024 23:50 UTC

And whats the roadmap for an asyncified module
loader, is this on the radar of Python?

Mild Shock schrieb:
>
> I am still waiting for async files in the
> style of nodejs that works on windows and
>
> is bundled with the main python distribution.
> I am not very  fond on doing something
>
> like adding listeners to a file descriptor,
> in nodejs async files are based on callbacks
>
> not on listeners. Whats the roadmap here?
>
> Lawrence D'Oliveiro schrieb:
>> On 2 Feb 2024 09:12:06 GMT, Stefan Ram wrote:
>>
>>> |The IO part of the event loop is built upon a single crucial
>>> |function called "select".
>>
>> select(2) has limitations. Better to use poll(2). Depending on *nix
>> variant, other more advanced alternatives may also be available
>> <https://docs.python.org/3/library/select.html>.
>>
>

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor