[Python-ideas] Allow filter(items)
Stephen J. Turnbull
stephen at xemacs.org
Wed Aug 7 05:32:07 CEST 2013
Ethan Furman writes:
> On 08/05/2013 11:31 AM, � wrote:
> > -1 There should be only one way and there are lots of ways
> > already. Use a genexp for readability: (x for x in items if x)
>
> One Obvious Way *not* Only One Way. :)
The actual statement is in the middle:
There should be one-- and preferably only one --obvious way to do it.
I assume that's the "only one" the OP meant.
Of course there's more than one way; that's inherent in a language
where you can define named functions, then call them by name -- or
inline their definitions if you prefer.
But it's definitely better for readability if everybody can agree on
TOOWTDI.
More information about the Python-ideas
mailing list