filter and map / deprecated?

Serge Orlov sombDELETE at pobox.ru
Wed Dec 17 14:45:39 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.

You will have to port and and test your scripts on the new Python.
You aren't going to use them untested, are you? In case of
filter & map you will just have to (my guess) insert:
from legacy import filter, map
Using filter & map these days is discouraged, use itertools
module.

Anyway I think before they disappear they should be removed
from documentation and _books_ first. I mean old books should
become obsolete, new books and documentation should briefly
mention them in the legacy chapter. These are should be no
trace of them in the main chapters. And then the functions can
be actually removed from the Python core. I beleive this is the
least painful way to get rid of them. The cost of keeping them
in the core is very low, the main problem is documentation.
So the process of deprecitation should focus on the documentation.

-- Serge.






More information about the Python-list mailing list