@classmethod<EOL><INDENT>def _add_numeric_methods_binary(cls):<DEDENT>
def _make_evaluate_binop(op, step=False):<EOL><INDENT>"""<STR_LIT>"""<EOL>def _evaluate_numeric_binop(self, other):<EOL><INDENT>if isinstance(other, (ABCSeries, ABCDataFrame)):<EOL><INDENT>return NotImplemented<EOL><DEDENT>elif isinstance(other, ABCTimedeltaIndex):<EOL><INDENT>return NotImplemented<EOL><DEDENT>elif isinstance(other, (timedelta, np.timedelta64)):<EOL><INDENT>return op(self._int64index, other)<EOL><DEDENT>elif is_timedelta64_dtype(other):<EOL><INDENT>return op(self._int64index, other)<EOL><DEDENT>other = self._validate_for_numeric_binop(other, op)<EOL>attrs = self._get_attributes_dict()<EOL>attrs = self._maybe_update_attributes(attrs)<EOL>left, right = self, other<EOL>try:<EOL><INDENT>if step:<EOL><INDENT>with np.errstate(all='<STR_LIT:ignore>'):<EOL><INDENT>rstep = step(left._step, right)<EOL><DEDENT>if not is_integer(rstep) or not rstep:<EOL><INDENT>raise ValueError<EOL><DEDENT><DEDENT>else:<EOL><INDENT>rstep = left._step<EOL><DEDENT>with np.errstate(all='<STR_LIT:ignore>'):<EOL><INDENT>rstart = op(left._start, right)<EOL>rstop = op(left._stop, right)<EOL><DEDENT>result = RangeIndex(rstart,<EOL>rstop,<EOL>rstep,<EOL>**attrs)<EOL>if not all(is_integer(x) for x in<EOL>[rstart, rstop, rstep]):<EOL><INDENT>result = result.astype('<STR_LIT>')<EOL><DEDENT>return result<EOL><DEDENT>except (ValueError, TypeError, ZeroDivisionError):<EOL><INDENT>return op(self._int64index, other)<EOL><DEDENT><DEDENT>name = '<STR_LIT>'.format(name=op.__name__)<EOL>return compat.set_function_name(_evaluate_numeric_binop, name, cls)<EOL><DEDENT>cls.__add__ = _make_evaluate_binop(operator.add)<EOL>cls.__radd__ = _make_evaluate_binop(ops.radd)<EOL>cls.__sub__ = _make_evaluate_binop(operator.sub)<EOL>cls.__rsub__ = _make_evaluate_binop(ops.rsub)<EOL>cls.__mul__ = _make_evaluate_binop(operator.mul, step=operator.mul)<EOL>cls.__rmul__ = _make_evaluate_binop(ops.rmul, step=ops.rmul)<EOL>cls.__truediv__ = _make_evaluate_binop(operator.truediv,<EOL>step=operator.truediv)<EOL>cls.__rtruediv__ = _make_evaluate_binop(ops.rtruediv,<EOL>step=ops.rtruediv)<EOL>
add in numeric methods, specialized to RangeIndex