Comments on Version 2, Draft Pep for Deprecating Builtins

Duncan Booth duncan at NOSPAMrcp.co.uk
Tue Apr 30 03:59:27 EDT 2002


[posted and mailed]

holger krekel <pyth at devel.trillke.net> wrote in
news:mailman.1020100431.16386.python-list at python.org: 

>> > Btw, what is the best/shortest way to express 'filter' and 'reduce'
>> > with list comprehensions?
<snip>

> You really feel that these free floating strings with
> no clear separations and lots of micro-management where
> you dont't even know what does what and where the parts
> start to float around and you ask yourself 
> when the sentence will ever end 
> 
I didn't say that. The question was what was the best/shortest way to 
replace the functions with list comprehensions. I answered the question. I 
did not say anywhere that they were always better than the functional 
alternative.

There are times when map/filter/reduce are the obvious ways to do things. 
What I did say, but you trimmed, was that I believe that if writing an 
explicit for loop removes the use of a lambda, then that is an improvement.

-- 
Duncan Booth                                             duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?



More information about the Python-list mailing list