.. index:: py::builtins::range::operator = .. _doxycast_pypp_classpy_1_1builtins_1_1range_1ad40ad05e6a49abfb28b4d899a9308c93: .. _py-builtins-range-operator-assign: *py::builtins::range::*\ operator = =================================== .. code-block:: cpp constexpr range& operator = (const range& other); // 1 constexpr range& operator = (range&& other); // 2 Assigns another range to the range. Parameters ---------- ``other``: Another range. Return value ------------ ``*this``. Complexity ---------- Constant. Example ------- .. code-block:: cpp #include #include int main() { py::range range(10); range = py::range(20); py::print(range.stop()); } **Output**: .. code-block:: text 20