
Nov. 28, 2017
5:07 a.m.
Kirill Balunov wrote:
So someone too perlish clever can assume that with the proposed syntax:
def gen(): for i in ['a', 'b', 'c', 'd']: v = x if 'x' in globals() else 'var ' yield v + i
x, y = gen() x var a y var ab
There's no need for that to happen. It can still unpack all the values it needs before performing any assignments. -- Greg