[Python-ideas] custom predicate for all() & any()

Sven R. Kunze srkunze at mail.de
Tue Mar 29 14:38:22 EDT 2016


On 29.03.2016 20:32, Wes Turner wrote:
> * "predicate" seems to be the common term
>
> * (predicate, iterable) seems to be the, at least in Python, common 
> function signature
>
> * itertools.ifilter (predicate, iterable)
>
> https://docs.python.org/2/library/itertools.html#itertools.ifilter
>
> * python3: filter(function, iterable))
>
> https://docs.python.org/3/library/functions.html#filter
>
> * toolz: *(predicate, iterable)
>
> * funcy.ifilter(pred, seq)
>
> http://funcy.readthedocs.org/en/stable/seqs.html#transform-and-filter
>
> ... "iterable" / sequence
>

filtering, yes; not mapping

> >> Of course the number of parentheses involved is an
>
> >> indicator of the complexity. Not sure if there is another way of
> >> handling this;
>
> * git commit
> * :PymodeLintAuto #vim
> * git diff
> * git commit
>
> ... or gg=G  #vim
>

PyCharm?


Best,
Sven


More information about the Python-ideas mailing list