[Python-Dev] Tricky way of of creating a generator via a comprehension expression

Guido van Rossum guido at python.org
Wed Nov 22 14:33:30 EST 2017


On Wed, Nov 22, 2017 at 11:12 AM, Ivan Levkivskyi <levkivskyi at gmail.com>
wrote:

> On 22 November 2017 at 20:05, Guido van Rossum <guido at python.org> wrote:
>
>> On Wed, Nov 22, 2017 at 10:54 AM, Jelle Zijlstra <
>> jelle.zijlstra at gmail.com> wrote
>>
>>> 2017-11-22 9:58 GMT-08:00 Guido van Rossum <guido at python.org>:
>>>
>> (OTOH, await in the same position must keep working since it's not broken
>>> and not unintuitive either.)
>>>
>>
>>
>
> This is very questionable IMO.
> So do you think that [await x for y in z] and list(await x for y in z)
> being not equivalent is intuitive?
>

I see, that's why this is such a long thread. :-(

But are they different? I can't find an example where they don't give the
same outcome.

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20171122/3605a096/attachment.html>


More information about the Python-Dev mailing list