I need to do something that is functionally equivalent to this:
for foo in foos: bar = foo.get_bar() # Do something with bar
My first i
This modified code will work:
for bar in map(lambda f: f.get_bar(), foos): # Do something with bar
You provide lambda function here. Simply providing get_bar doesn't work because it is accessible only through an instance of class (f.get_bar()), never by itself.
get_bar
f.get_bar()