Message63026
| Author |
gvanrossum |
| Recipients |
belopolsky, benjamin.peterson, gvanrossum, rhettinger |
| Date |
2008年02月26日.04:40:59 |
| SpamBayes Score |
0.03209166 |
| Marked as misclassified |
No |
| Message-id |
<ca471dc20802252040l1cef565do3e7335794933fece@mail.gmail.com> |
| In-reply-to |
<1203990995.48.0.818155715259.issue2186@psf.upfronthosting.co.za> |
| Content |
> What do you guys think about just making the predicate argument optional?
>
> filter([-2,0,2]) --> -2, 2
> filter(pred, iterable)
>
> One arg is the first case and two args is the second case.
-1. Apart from range() this is used nowhere else in Python. (Well, it
is in curses, but it's an abomination there too.) I'd rather keep
explicit None that *this*, though I really don't see what's wrong with
filter(bool, ...) -- you can even optimize for that pattern. |
|