def union(a, b): if isinstance(a,collections.Hashable) and isinstance(b,collections.Hashable): c = set(a) | set(b) else: c = unique(a + b) return c