Most efficient solution?

Christopher A. Craig com-nospam at ccraig.org
Tue Jul 17 08:25:12 EDT 2001


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

alf at leo.logilab.fr (Alexandre Fayolle) writes:

> I suppose that the first loop could also be rewritten using map, in order 
> to squeeze some more juice out of the beast:
> 
> C={}
> map(lambda item,dic = C: dic[item]=1, B)

I doubt this would save you anything because the cost of that lambda
function will most likely be greater than the savings from the for
loop.

- -- 
Christopher A. Craig <com-nospam at ccraig.org>
"How does a project get to be a year late? 
- -- One day at a time" - Frederick Brooks, Jr.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Processed by Mailcrypt

iEYEARECAAYFAjtULqgACgkQjVztv3T8pztPCQCfUEcjOUN7cdjQBX8GuRieA3Dr
pZ4AnRo9TobmYzQTQmRRWhNKn/JmFn2U
=IF0V
-----END PGP SIGNATURE-----



More information about the Python-list mailing list