filter and map / deprecated?

John Roth newsgroups at jhrothjr.com
Wed Dec 17 16:23:33 EST 2003


"Logan" <logan at phreaker.nospam> wrote in message
news:pan.2003.12.17.18.35.25.713854 at phreaker.nospam...
> I read in PEP 279 the following comment by GvR:
>
>     "filter and map should die and be subsumed into list
>     comprehensions, not grow more variants."
>
> Actually, I am using 'filter' and 'map' a lot in my scripts
> (not really because they are necessary, but more because I
> like them). Should I avoid the usage of 'filter' and 'map'
> in the future? The above comment by GvR makes me a little
> bit afraid that they will become deprecated one day and that
> I will have to change many of my scripts then.

My understanding is that they are on the list of functions
to go away in 3.0. Guido would like to get rid of all five
of the "functional programming" mechanisms. So far,
filter, map and apply have acceptable substitutes, and
the arm waving brigade is claiming that the new sum()
function will handle all "real" use cases for reduce. (You
can tell I don't agree, but that doesn't seem to be
relevant.) Lambda is the odd man out at this point.
I believe it's waiting on an acceptable syntax
for blocks, which seems to be very hard to do.

John Roth
>
> -- 
> mailto: logan at phreaker(NoSpam).net
>






More information about the Python-list mailing list