funcy
funcy copied to clipboard
group by docs
This wasn't easy for me to figure out from the docs.
Curious: any interest in allowing a string to be passed to group_by
as the function? i.e.
group_by("age", [{"age": 10, "name": "Alice"}])
if the seq elements are a dictionary, "age" could be automatically converted into an itemgetter
. Feels more intuitive to me.
group_by()
already transforms various non-callables including string to functions, i.e. string is transformed as regex match, see https://funcy.readthedocs.io/en/stable/extended_fns.html
While I support examples in docs the ones here feel too verbose and extra tests excessive.