pydu/docs/list.rst

14 lines
376 B
ReStructuredText
Raw Normal View History

2017-12-14 12:08:03 +00:00
List
----
.. py:function:: pydu.list.uniq(seq, key=None)
Removes duplicate elements from a list while preserving the order of the rest.
The value of the optional ``key`` parameter should be a function that
takes a single argument and returns a key to test the uniqueness.
>>> from pydu.list import uniq
>>> uniq([1, 4, 0, 2, 0, 3])
[1, 4, 0, 2, 3]