more on "Is this considered black magic?"

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Mon Dec 3 05:04:46 EST 2001


Mon, 03 Dec 2001 10:21:32 +0100, Beda Kosata <kosatab at vscht.cz> pisze:

> 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.

If you don't need the results, a 'for' loop is more straightforward:

for i in objects: o.method(args)

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^
QRCZAK



More information about the Python-list mailing list