Merge pull request #434 from bennylope/bennylope-patch-1

Add docstring documentation for utils.unique
This commit is contained in:
Dirk Eschler 2017-10-30 14:10:24 +01:00 committed by GitHub
commit fa60d1852f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -95,6 +95,10 @@ def build_css_class(localized_fieldname, prefix=''):
def unique(seq):
"""
Returns a generator yielding unique sequence members in order
A set by itself will return unique values without any regard for order.
>>> list(unique([1, 2, 3, 2, 2, 4, 1]))
[1, 2, 3, 4]
"""