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

sortify and uniquify helpers #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

rbu
Copy link

@rbu rbu commented Mar 12, 2015

No description provided.

@rbu
Copy link
Author

rbu commented Mar 12, 2015

Note: I have not added the functions to __all__ to avoid merge conflicts with my other PR.

@@ -146,6 +146,87 @@ def iterate_flatten(q):
return chain.from_iterable(q)


def unique(iterable_with_duplicates):
Copy link
Owner

Choose a reason for hiding this comment

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

Isn't this the same as doing set(iterable_with_duplicates)?

Copy link
Author

Choose a reason for hiding this comment

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

No, as it preserves the ordering (and returns a list).

Copy link
Owner

Choose a reason for hiding this comment

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

Ah, got it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants