4 ms·
Oh my, that's awful. Even in python there are better ways to close over a value :) I haven't written python in many years, but in the following example it is a
by bjoli 5y ago
Oh my, that's awful. Even in python there are better ways to close over a value :)
I haven't written python in many years, but in the following example it is at least clear what is going on:
def make_printer(n):
def printer():
print(n)
return printer
[make_printer(i) for i in range(2)]