First some boilerplate:
def side_effecty_id(x):
print(x)
return x
Now, consider:
lambdas_0 = tuple((lambda x: x >= side_effecty_id(i)) for i in range(10))
tuple(l(5) for l in lambdas_0)
Curiously, this gives
9
9
9
9
9
9
9
9
9
9
(False, False, False, False, False, False, False, False, False, False)
while
lambdas_1 = tuple((lambda i: lambda x: x >= side_effecty_id(i))(i) for i in range(10))
tuple(l(5) for l in lambdas_1)
gives
0
1
2
3
4
5
6
7
8
9
(True, True, True, True, True, True, False, False, False, False)