def _union(self, other, sort):
    assert isinstance(other, type(self))
    assert (self.dtype == other.dtype)
    if self._can_range_setop(other):
        return self._range_union(other, sort=sort)
    if self._can_fast_union(other):
        result = self._fast_union(other, sort=sort)
        return result
    else:
        return super()._union(other, sort)._with_freq('infer')
def _union(self, other, sort):
    assert isinstance(other, type(self))
    assert (self.dtype == other.dtype)
    if self._can_range_setop(other):
        return self._range_union(other, sort=sort)
    if self._can_fast_union(other):
        result = self._fast_union(other, sort=sort)
        return result
    else:
        return super()._union(other, sort)._with_freq('infer')