2 ms·
The author did not create any closures in the example code. Python only creates a closure for a def in a def. Regardless, using functools.partial solves that p
by xapata 10y ago
The author did not create any closures in the example code. Python only creates a closure for a def in a def.
Regardless, using functools.partial solves that problem: ``callback = partial(print, i)``.