8 Mar
2016
8 Mar
'16
2:01 p.m.
On Wed, Mar 9, 2016 at 5:57 AM, Joseph Jevnik
If we were to translate this to python syntax we could have something like: [r + 1 for n in range(1, 11) for n * 3 as r if r % 4 == 0] There is no reason that the name binding needs to be a part of the predicate expression, they can just be seperate clauses. I think the `for expr as name` is nice because it matches the order that comprehensions over multiple iterators are evaluated like: `[n for n in ns for m in ms]`.
That's somewhat more appealing. Not enthused about "for expr as name"; maybe "with expr as name"? Aside from not calling __enter__ and __exit__, it's the same kind of operation that a with block does. But the semantic difference isn't a good thing. ChrisA