We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e08072d commit 84aa2e8Copy full SHA for 84aa2e8
python/ql/src/Variables/LoopVariableCapture/examples/good2.py
@@ -1,5 +1,5 @@
1
import functools
2
-# GOOD: A default parameter is used, so the variable `i` is not being captured.
+# GOOD: `functools.partial` takes care of capturing the _value_ of `i`.
3
tasks = []
4
for i in range(5):
5
tasks.append(functools.partial(lambda i: print(i), i))
0 commit comments