Skip to content

Commit

Permalink
Merge 67cf8b3 into 8b764a2
Browse files Browse the repository at this point in the history
  • Loading branch information
SergBobrovsky committed Nov 12, 2019
2 parents 8b764a2 + 67cf8b3 commit 25bbe59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions more_itertools/more.py
Original file line number Diff line number Diff line change
Expand Up @@ -1580,8 +1580,8 @@ def groupby_transform(iterable, keyfunc=None, valuefunc=None):
duplicate groups, you should sort the iterable by the key function.
"""
valuefunc = (lambda x: x) if valuefunc is None else valuefunc
return ((k, map(valuefunc, g)) for k, g in groupby(iterable, keyfunc))
res = groupby(iterable, keyfunc)
return ((k, map(valuefunc, g)) for k, g in res) if valuefunc else res


def numeric_range(*args):
Expand Down

0 comments on commit 25bbe59

Please sign in to comment.