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

Add itertools.pluck_attr. #2668

Merged
merged 2 commits into from
Feb 17, 2023
Merged

Add itertools.pluck_attr. #2668

merged 2 commits into from
Feb 17, 2023

Conversation

jaheba
Copy link
Contributor

@jaheba jaheba commented Feb 17, 2023

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Please tag this pr with at least one of these labels to make our release process faster: BREAKING, new feature, bug fix, other change, dev setup

_no_default = object()


@curry
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love curry

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Such tasty!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much spice



@curry
def pluck_attr(seq, name, default=_no_default):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does "pluck" come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, but it's a common term used. Normally it's for dictionaries.

For example: https://toolz.readthedocs.io/en/latest/api.html#toolz.itertoolz.pluck

@jaheba jaheba merged commit f0b640e into awslabs:dev Feb 17, 2023
@jaheba jaheba deleted the itertools-pluck_attr branch February 17, 2023 13:51
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.

None yet

2 participants