Using a lambda (or any function) in a loop can be considered a code smell in Python (and often in other languages like C++) for several reasons. Here's why it can be problematic:
In Python, using a lambda function in a loop can lead to unexpected behavior due to late binding. This means the lambda function captures the variable, not the value. So, if the lambda uses loop variables, it will use the final value of the variable, not the value it had when the function was defined.
funcs = [lambda x: x + i for i in range(3)]
for func in funcs: