Apply review suggestion - Tweak wording of example comment

Co-authored-by: Taus <tausbn@github.com>
This commit is contained in:
Joe Farebrother
2025-04-09 14:07:38 +01:00
committed by GitHub
parent e08072d77b
commit 84aa2e8627

View File

@@ -1,5 +1,5 @@
import functools
# 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`.
tasks = []
for i in range(5):
tasks.append(functools.partial(lambda i: print(i), i))