Python Tutorial Was: Guido's regrets: filter and map

Jeremy Fincher tweedgeezer at hotmail.com
Tue Nov 26 13:46:35 EST 2002


Thomas Guettler <pan-newsreader at thomas-guettler.de> wrote in message news:<pan.2002.11.24.08.05.38.521605.727 at thomas-guettler.de>...
> I never liked filter, map and reduce. 
> 
> I think it would be good to remove them from the python tutorial. 
> I think the tutorial would be easier for newbies it
> it would be smaller.

The biggest problem with filter, map, and reduce is that they're
functions, not methods.  All this discussion about list comprehensions
versus filter/map ignores one major disadvantage of list
comprehensions: that they only work with lists.  If filter/map/reduce
had been *methods* on list objects, then a programmer could implement
his own container objects (binary trees, subclasses of list, etc.)
with their own filter/map/reduce methods to construct like containers,
and people would be happier.

As far as the tutorial goes, filter/map/reduce could be "discovered"
just like the rest of the methods that aren't emphasized in the
tutorial.

Jeremy



More information about the Python-list mailing list