def union(self, other):
    self_repr = self.get_repr()
    other_repr = other.get_repr()
    if (self_repr == other_repr):
        return
    if isinstance(other, TypeVar):
        other_rank = other.rank
        self_rank = self.rank
        if (self_rank < other_rank):
            self.parent = other_repr
        elif (self_rank > other_rank):
            other.parent = self_repr
        else:
            other.parent = self_repr
            self.rank = (self.rank + 1)
    else:
        self.parent = other_repr
def union(self, other):
    self_repr = self.get_repr()
    other_repr = other.get_repr()
    if (self_repr == other_repr):
        return
    if isinstance(other, TypeVar):
        other_rank = other.rank
        self_rank = self.rank
        if (self_rank < other_rank):
            self.parent = other_repr
        elif (self_rank > other_rank):
            other.parent = self_repr
        else:
            other.parent = self_repr
            self.rank = (self.rank + 1)
    else:
        self.parent = other_repr