[Python-Dev] Tricky way of of creating a generator via a comprehension expression (original) (raw)
Antoine Pitrou solipsis at pitrou.net
Thu Nov 23 06:53:26 EST 2017
- Previous message (by thread): [Python-Dev] Tricky way of of creating a generator via a comprehension expression
- Next message (by thread): [Python-Dev] PEP 559 - built-in noop()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, 23 Nov 2017 09:50:27 +0000 Paul Moore <p.f.moore at gmail.com> wrote:
On 23 November 2017 at 09:14, Steve Holden <steve at holdenweb.com> wrote: > I would urge developers, in their improvements to the language to support > asynchronous programming, to bear in mind that this is (currently) a > minority use case. Why the rush to set complex semantics in stone?
+1 Also, given that languages like C# have similar async/await functionality, I'd be interested to know how they address questions like this. If they have a parallel, we should probably follow it. If they don't that would be further indication that no-one has much experience of the "best answers" yet, and caution is indicated.
This discussion isn't about async/wait or asynchronous programming.
It's about "yield" (which used to be the standard for asynchronous programming before async/await, but isn't anymore). The fact that "await" is now the standard still weakens the case for "yield" inside comprehensions and generator expressions.
As someone who does asynchronous programming daily using "yield" (because of compatibility requirements with Python 2), I don't think I've even tried to use "yield" in a comprehension or generator expression. The use case doesn't seem to exist.
Regards
Antoine.
- Previous message (by thread): [Python-Dev] Tricky way of of creating a generator via a comprehension expression
- Next message (by thread): [Python-Dev] PEP 559 - built-in noop()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]