◐ Shell
clean mode source ↗

Message 63483 - Python tracker

Do you guys see any merit in changing the argument order for ifilter so
that the predicate function can just be an optional argument:

  ifilter(data[, pred])

Alex Martelli successfully lobbied for groupby() to have that same
argument order.  Originally, the signature was groupby(key, iterable)
but it worked-out much better to have groupby(iterable[, key]).

Also, I like swapped arguments because it more closely parallels the
order used in an equivalent list comprehension:

   [e for e in iterable if pred(e)]