.. index:: py::builtins::list::reverse .. _doxycast_pypp_classpy_1_1builtins_1_1list_1ac0299faaff27fc2fa9cc6f1aa4e025a2: .. _py-builtins-list-reverse: *py::builtins::list::*\ reverse =============================== .. code-block:: cpp void reverse(); Reverses the list. Complexity ---------- Linear in the size of the list. Example ------- .. code-block:: cpp #include #include int main() { py::list list = {0, 0, 1, 3}; py::print(list); list.reverse(true); py::print(list); } **Output**: .. code-block:: text {0, 0, 1, 3} {3, 1, 0, 0}