We have functions like
void myf(const boost::python::list& l) {...}
is there a way to accept any python iterable, or less generically, any collection?
There’s boost::python::stl_input_iterator, so you can do something like
template<typename T>
inline std::vector< T > py_list_to_std_vector(const boost::python::object& iterable)
{
return std::vector< T >(boost::python::stl_input_iterator< T >(iterable),
boost::python::stl_input_iterator< T >());
}