Conditional iteration

Gabriel Genellina gagsl-py at yahoo.com.ar
Fri Dec 15 05:11:23 EST 2006


At Friday 15/12/2006 06:51, mystilleef wrote:

>This why I prefer functional programming constructs for my
>list/sequence processing needs.
>
>------------------------------------------------------------------------
>is_true = lambda x: x > 0
>map(process_list, filter(is_true, [-2, -1, 0, 1, 2, 3, 4]))
>------------------------------------------------------------------------

Be aware that map, filter, and reduce may be dropped in Python 3000.
http://www.artima.com/weblogs/viewpost.jsp?thread=98196
(and I won't miss them if gone)


-- 
Gabriel Genellina
Softlab SRL 

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar



More information about the Python-list mailing list