Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 84aa2e8

Browse files
Apply review suggestion - Tweak wording of example comment
Co-authored-by: Taus <[email protected]>
1 parent e08072d commit 84aa2e8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • python/ql/src/Variables/LoopVariableCapture/examples

python/ql/src/Variables/LoopVariableCapture/examples/good2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import functools
2-
# GOOD: A default parameter is used, so the variable `i` is not being captured.
2+
# GOOD: `functools.partial` takes care of capturing the _value_ of `i`.
33
tasks = []
44
for i in range(5):
55
tasks.append(functools.partial(lambda i: print(i), i))

0 commit comments

Comments
 (0)