.. index:: py::builtins::list::pop .. _doxycast_pypp_classpy_1_1builtins_1_1list_1a6caf93b05b1451f9fa718dcbf1416bdb: .. _py-builtins-list-pop: *py::builtins::list::*\ pop =========================== .. code-block:: cpp value_type pop(long index = -1); Removes the element at given index (the last element by default). Parameters ---------- ``index``: The index of the element. Return value ------------ The removed element. Complexity ---------- Same as the complexity of ``std::vector::erase``. Example ------- .. code-block:: cpp #include #include int main() { py::list list = {0, 1}; py::print(list); list.pop(); py::print(list); } **Output**: .. code-block:: text {0, 1} {0}