def filter_duplicates(l):
    """
    >>> filter_duplicates([{'a': 1}, {'b': 1}, {'a': 1}])
    [{'a': 1}, {'b': 1}]
    """
    def make_hashable(o):
        try:
            hash(o)
            return o
        except TypeError:
            return helper[type(o)](o)

    helper = {
        set: lambda o: tuple([make_hashable(e) for e in o]),
        tuple: lambda o: tuple([make_hashable(e) for e in o]),
        list: lambda o: tuple([make_hashable(e) for e in o]),
        dict: lambda o: frozenset(
            [(make_hashable(k), make_hashable(v)) for k, v in
             o.items()]),
    }

    l = list(l)

    return list({
        hashable: entry
        for hashable, entry in zip(make_hashable(l), l)
    }.values())