Appliying method to list of objects

eloy eloy at rabinf50.uco.es
Thu May 31 09:57:43 EDT 2001


Help, please.

I couldn't find a cannonical (ti!mtowtdi) and efficient way to improve
this:

	for i in list:
		i.dosomething()

Perhaps

	map( lambda x: x.dosomething(), list )

But the lambda screeches, somehow: I guess there must be a better way to
do it.

Using apply()?. But how?.

I'm a bit new, so sorry if this is an easy one :).

                                        -- Eloy
_____________________________________________________________________
---- Eloy Rafael Sanz Tapia -- ersanz at uco.es -- ma1satae at uco.es -----
------------------ http://www.uco.es/~ma1satae ----------------------
----------- GPG ID: 190169A0 / finger eloy at rabinf50.uco.es ----------
Córdoba _ España _______________ Debian 2.2 GNU/Linux 2.2.19 rabinf50




More information about the Python-list mailing list