extended list comprehensions

Laura Creighton lac at strakt.com
Sun May 26 23:37:28 EDT 2002


> It would be great to have something like a list comprehension for the
> reduce function. It would work in the same way as the comprehension
> for the map function, which is:
> 
> [foo(x) for x in xs]      <-is the same as->       map(foo,xs)
> 
> and maybe it could be written as:
> 
> {y=y+x for x in xs}      <-would be->         reduce(operator.add,xs)
> 
> what do the experts think about that ? 
> 
> ferdinand
> -- 
> http://mail.python.org/mailman/listinfo/python-list

Adding more typography makes our language ugly and hard to read.

Laura Creighton





More information about the Python-list mailing list