On Feb 22 2018, Serhiy Storchaka <[email protected]> wrote:
> 1. Inner generator expression:
>
> result = [y + g(y) for y in (f(x) for x in range(10))]
>
[...]
>
> And maybe there are other ways.
I think the syntax recently brough up by Nick is still the most
beautiful:
result = [ (f(x) as y) + g(y) for x in range(10)]
..but I wonder if it is feasible to make the interpreter sufficiently
smart to evaluate the first summand before the second.
Best,
-Nikolaus
--
GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F
»Time flies like an arrow, fruit flies like a Banana.«
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com