Creating lambda expressions in comprehension list code example
Example 1: Creating lambda expressions in comprehension list
lambdas_list = [ (lambda a: lambda: a.some_var)(o) for o in obj_list ]
Example 2: Creating lambda expressions in comprehension list
lambdas_list = [ lambda i=o: i.some_var for o in obj_list ]