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

Closed
wants to merge 1 commit into
from

Conversation

4 participants
@snoack
Contributor

snoack commented Aug 4, 2015

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.

@@ -51,21 +51,24 @@ def environmentfilter(f):
return f
def make_attrgetter(environment, attribute):
def make_attrgetter(environment, attribute, lowercase=False):

This comment has been minimized.

@ThiefMaster

ThiefMaster Jan 29, 2017

Member

Does this really fit in this function? I'd rather have the option to pass an arbitrary postprocess callable that'll be applied before returning the attribute's value.

@ThiefMaster

ThiefMaster Jan 29, 2017

Member

Does this really fit in this function? I'd rather have the option to pass an arbitrary postprocess callable that'll be applied before returning the attribute's value.

This comment has been minimized.

@davidism

davidism Apr 13, 2017

Member

sort and dictsort use the name case_sensitive.

@davidism

davidism Apr 13, 2017

Member

sort and dictsort use the name case_sensitive.

@@ -51,21 +51,24 @@ def environmentfilter(f):
return f
def make_attrgetter(environment, attribute):
def make_attrgetter(environment, attribute, lowercase=False):

This comment has been minimized.

@davidism

davidism Apr 13, 2017

Member

sort and dictsort use the name case_sensitive.

@davidism

davidism Apr 13, 2017

Member

sort and dictsort use the name case_sensitive.

key = getter(item)
if key not in seen:
seen.add(key)
rv.append(item)

This comment has been minimized.

@davidism

davidism Apr 13, 2017

Member

This should yield item instead of building the full list ahead of time.

@davidism

davidism Apr 13, 2017

Member

This should yield item instead of building the full list ahead of time.

@davidism

This comment has been minimized.

Show comment
Hide comment
@davidism

davidism Apr 13, 2017

Member

Needs a changelog entry.

Member

davidism commented Apr 13, 2017

Needs a changelog entry.

@Talkless

This comment has been minimized.

Show comment
Hide comment
@Talkless

Talkless Apr 13, 2017

@snoack Are you yet interested in fixing this PR?

@snoack Are you yet interested in fixing this PR?

@davidism davidism referenced this pull request Jul 5, 2017

Merged

Unique filter #735

@davidism

This comment has been minimized.

Show comment
Hide comment
@davidism

davidism Jul 5, 2017

Member

Continued in #735

Member

davidism commented Jul 5, 2017

Continued in #735

@davidism davidism closed this Jul 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment