
Jan. 24, 2016
8:42 p.m.
Nick Coghlan wrote:
Capturing additional values on each iteration would be possible with a generator expression:
for new i, a, b, c in (i, a, b, c for i range(10)): def f(x): return x**i, a, b, c
I'm not sure I see the point of this. If you're needing to capture a, b and c from an outer scope, presumably it's because there's some outer loop that's changing them -- in which case you can just make *that* loop a "new" loop as well. BTW, should there be a "while new" loop too? -- Greg