more on "Is this considered black magic?"
Beda Kosata
kosatab at vscht.cz
Mon Dec 3 04:21:32 EST 2001
More than 2 weeks ago there was a debate on how to call a method for
each object in list. Because I missed it I'm replaying now.
I personaly use map() for this:
map( lambda o: o.method( args), objects)
The solution is not very error prone, but when you know what you have in
your list it works just fine. As a side effect you also get list of results.
results = map( lambda o: o.method( args), objects)
BEDA
More information about the Python-list
mailing list