Release 0.3.1: Addition of distinct_by
This is a very minor release which adds distinct_by
to the API. distinct_by
takes a single identity function as argument. The returned sequence is unique by the identity function and consists of the first element found for each identity key. Code example below:
from functional import seq
seq([(1, 2), (1, 3), (2, 3), (4, 5), (0, 1), (0, 0)]).distinct_by(lambda x: x[0])
# [(0, 1), (1, 2), (2, 3), (4, 5)]