py::builtins::list::operator =

list& operator = (const list& other);

Assigns another list or slice to the list.

Parameters

other: Another list or slice.

Return value

*this.

Complexity

Linear in the size of other.

Example

#include <pypp/builtins/list.hpp>
#include <pypp/builtins/print.hpp>

int main()
{
    py::list<int> list{0, 9, 1, 3};
    list = {5}
    py::print(list);
}

Output:

{5}