'Find the sets containing the objects and merge them all.'

def union(self, *objects):

    roots = [self[x] for x in objects]
    heaviest = max(roots, key=(lambda r: self.weights[r]))
    for r in roots:
        if (r != heaviest):
            self.weights[heaviest] += self.weights[r]
            self.parents[r] = heaviest
