Fixed - I implemented it the way you suggested, liking it fine.

On Oct 2, 2013, at 10:47 AM, Matthew Rocklin <notifications@github.com> wrote:

> In toolz/itertoolz/tests/test_recipes.py:
> 
> > @@ -8,3 +8,19 @@ def even(x):
> >  def test_countby():
> >      assert countby(even, [1, 2, 3]) == {True: 1, False: 2}
> >      assert countby(len, ['cat', 'dog', 'mouse']) == {3: 2, 5: 1}
> > +
> > +
> > +def test_partitionby():
> > +    assert list(partitionby(identity, [])) == []
> > +
> > +    vowel = lambda l: l in "aeiou"
> Feel free to ignore these comments:
> 
> Recommend isvowel for predicates in Python. Similar to isinstance.
> 
> When I'm feeling fancy I do something like
> 
> vowels = 'aeiou'
> 
> assert list(partitionby(vowels.__contains__, "abcdefghi")) == ...
> —
> Reply to this email directly or view it on GitHub.
>