Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

group by docs #150

Closed
wants to merge 4 commits into from
Closed

group by docs #150

wants to merge 4 commits into from

Conversation

iloveitaly
Copy link
Contributor

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.

@Suor
Copy link
Owner

Suor commented Feb 20, 2024

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.

@iloveitaly
Copy link
Contributor Author

Makes sense, closing!

@iloveitaly iloveitaly closed this Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants