def distinct(lst, uniqueness_function):
    """ Returns a list in the same order with just the elements with a distinct
	value on the uniqueness_function.
	I.e.: `distinct([1, 5, 7, 9], lambda x: x % 3)` would return [1, 5, 9]."""
    values = []
    keys = []
    for v in lst:
        k = uniqueness_function(v)
        if k not in keys:
            keys.append(k)
            values.append(v)
    return values
