1 [section boost_python_list.hpp]
3 Exposes a [link concepts.objectwrapper.typewrapper_concept_requirements TypeWrapper] for the Python [@http://www.python.org/doc/current/lib/typesseq-mutable.html list] type.
6 Exposes the [@http://www.python.org/doc/current/lib/typesseq-mutable.html mapping protocol] of Python's built-in `list` type. The semantics of the constructors and member functions defined below can be fully understood by reading the [link concepts.objectwrapper.typewrapper_concept_requirements TypeWrapper] concept definition. Since `list` is publicly derived from [link object_wrappers.boost_python_object_hpp.class_object `object`], the public `object` interface applies to `list` instances as well.``
7 namespace boost { namespace python
9 class list : public object
15 explicit list(T const& sequence);
18 void append(T const& x);
21 long count(T const& value) const;
24 void extend(T const& x);
27 long index(T const& x) const;
30 void insert(object const& index, T const& x); // insert object before index
32 object pop(); // remove and return item at index (default last)
33 object pop(long index);
34 object pop(object const& index);
37 void remove(T const& value);
39 void reverse(); // reverse *IN PLACE*
41 void sort(); // sort *IN PLACE*; if given, cmpfunc(x, y) -> -1, 0, 1
44 void sort(T const& value);
51 using namespace boost::python;
53 // Return the number of zeroes in the list