◐ Shell
clean mode source ↗

Message 277181 - Python tracker

Confirming.

Another use case is the use any lambda, or function definition inside the scope of a function, for checking conditions in the REPL.

Suppose two inner functions named condition1 and condition2, and a parameter X as a Collection:

(Pdb) any(condition1(x) and condition2(x) for x in X)
*** NameError: name 'condition1' is not defined