def method(self, other): oth = other if isinstance(other, Index): oth = other._data result = meth(self, oth) return wrap_arithmetic_op(self, other, result)
def __rtruediv__(self, other): oth = other if isinstance(other, Index): # TimedeltaArray defers, so we need to unwrap oth = other._values result = TimedeltaArray.__rtruediv__(self, oth) return wrap_arithmetic_op(self, other, result)
def __rsub__(self, other): result = self._data.__rsub__(other) return wrap_arithmetic_op(self, other, result)
def __sub__(self, other): # dispatch to ExtensionArray implementation result = self._data.__sub__(other) return wrap_arithmetic_op(self, other, result)
def method(self, other): result = meth(self._data, maybe_unwrap_index(other)) return wrap_arithmetic_op(self, other, result)
def _evaluate_with_timedelta_like(self, other, op): result = TimedeltaArray._evaluate_with_timedelta_like(self, other, op) return wrap_arithmetic_op(self, other, result)
def _evaluate_with_timedelta_like(self, other, op): result = TimedeltaArrayMixin._evaluate_with_timedelta_like(self, other, op) return wrap_arithmetic_op(self, other, result)