add iterutils.redundant to the docs

This commit is contained in:
Mahmoud Hashemi 2020-07-10 08:37:07 -07:00
parent d50a175c69
commit 5a47d92c54
2 changed files with 8 additions and 7 deletions

View File

@ -709,10 +709,10 @@ def unique_iter(src, key=None):
def redundant(src, key=None, groups=False): def redundant(src, key=None, groups=False):
"""The complement of :func:`unique()`. """The complement of :func:`unique()`.
By default returns non-unique values as a list of the *first* By default returns non-unique/duplicate values as a list of the
redundant value in *src*. Pass ``groups=True`` to get groups of *first* redundant value in *src*. Pass ``groups=True`` to get
all values with redundancies, ordered by position of the first groups of all values with redundancies, ordered by position of the
redundant value. This is useful in conjunction with some first redundant value. This is useful in conjunction with some
normalizing *key* function. normalizing *key* function.
>>> redundant([1, 2, 3, 4]) >>> redundant([1, 2, 3, 4])

View File

@ -24,6 +24,7 @@ present in the standard library.
.. autofunction:: windowed_iter .. autofunction:: windowed_iter
.. autofunction:: unique .. autofunction:: unique
.. autofunction:: unique_iter .. autofunction:: unique_iter
.. autofunction:: redundant
Stripping and splitting Stripping and splitting
----------------------- -----------------------