KCH KCH - 10 months ago 68
C++ Question

boost::python::list length

Is there any way to calculate length of list passed from python to C++? I want do do
something like this, but list class lacks

(or anything similar) method:

class Awesome{
void awesomeMethod(const boost::python::list& list_of_something){
list_of_something.length() // suprisingly there's no such method

Answer Source

Like Python, you should use the free function len() to get the length. Try