Random832 wrote:
For me, it's the fact that:
[[a for a in b] for b in ['uvw', 'xyz']] == [['u', 'v', 'w'], ['x', 'y',
which makes me want to write:
[a for a in b for b in ['uvw', 'xyz']]

You're not alone! Lately I've been becoming convinced that
this is the way we should have done it right back at the
beginning. But it's far too late to change it now, sadly.

Our only hope would be to introduce a new syntax, maybe

  [a for a in b; for b in ['uvw', 'xyz']]

Inserting the semicolons mightn't be such a bad idea,
because when doing the reversal it would be necessary to
keep any 'if' clauses together with their preceding
'for' clause. So if we wrote

  [a for a in b if cond(a); for b in things]

we could say the rule is that you split at the semicolons
and then reverse the clauses.

Python-ideas mailing list
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to