-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Added unique filter #469
Added unique filter #469
Conversation
@@ -51,21 +51,24 @@ def environmentfilter(f): | |||
return f | |||
|
|||
|
|||
def make_attrgetter(environment, attribute): | |||
def make_attrgetter(environment, attribute, lowercase=False): |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@@ -51,21 +51,24 @@ def environmentfilter(f): | |||
return f | |||
|
|||
|
|||
def make_attrgetter(environment, attribute): | |||
def make_attrgetter(environment, attribute, lowercase=False): |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
key = getter(item) | ||
if key not in seen: | ||
seen.add(key) | ||
rv.append(item) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Needs a changelog entry. |
@snoack Are you yet interested in fixing this PR? |
Continued in #735 |
4 years ago I suggested to add a
unique
filter, along with some other new filters as part of #66. That pull request has been closed, after some parts of it got implemented independently. However, I just saw a similar request (#443) for excluding duplicates using filters. So I rebased my old patch, added tests and did some logical improvements, that it hopefully get merged now.