[Python-3000] map, filter, reduce
Guido van Rossum
guido at python.org
Sat Jun 2 01:11:29 CEST 2007
I see no benefit in ireduce(), just more ways to write obfuscated code.
Regarding map() and filter(), I don't see what's unclear about PEP 3100:
"""
* Make built-ins return an iterator where appropriate (e.g. ``range()``,
``zip()``, ``map()``, ``filter()``, etc.) [zip and range: done]
"""
--Guido
On 6/2/07, Terry Reedy <tjreedy at udel.edu> wrote:
>
> "Georg Brandl" <g.brandl at gmx.net> wrote in message
> news:f3prce$9c$1 at sea.gmane.org...
> | How should an "ireduce" work? The result is not a sequence which could be
> | returned lazily.
>
> It would generate the sequence of partial reductions (potentially
> indefinately).
> list(ireduce(summer, 0, range(5)) = [0, 1, 3, 6, 10]
>
> This is obviously *not* the same as a reduce() which only returns the final
> value without the intermediate values.
>
> Terry Jan Reedy
>
>
>
>
>
>
>
> _______________________________________________
> Python-3000 mailing list
> Python-3000 at python.org
> http://mail.python.org/mailman/listinfo/python-3000
> Unsubscribe: http://mail.python.org/mailman/options/python-3000/guido%40python.org
>
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-3000
mailing list