hbutils.collection.sequence

unique

hbutils.collection.sequence.unique(s: Sequence[_ElementType]) → Sequence[_ElementType][source]
Overview:

Unique all the values in the given s, preserving its original order.

Parameters:

s – Original sequence.

Returns:

Unique sequence, with the original type.

Examples::
>>> from hbutils.collection import unique
>>>
>>> unique([1, 2, 3, 1])
[1, 2, 3]
>>> unique(('a', 'b', 'a', 'c', 'd', 'e', 'b'))
('a', 'b', 'c', 'd', 'e')
>>> unique([3, 1, 2, 1, 4, 3])
[3, 1, 2, 4]