[Python-ideas] startsin ?
mikegraham at gmail.com
Fri Sep 30 19:57:14 CEST 2011
On Fri, Sep 30, 2011 at 11:46 AM, David Stanek <dstanek at dstanek.com> wrote:
> I tend to do something like this a lot;
> any(somestring.startswith(x) for x in starts)
> Probably enough that having a method would be nice.
I wonder if it might be worthwhile to give any and all two-parameter API for
predicate functions, so that
is the same as
any(f(x) for x in xs)
This eliminates some really common boilerplate, but it adds complication and
has an ugly API.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas