[C++-sig] Problem accessing bp::list attributes in C++

christophe grimault christophe.grimault at novagrid.com
Thu Oct 30 10:38:07 CET 2008


Hi,

I wrote a function to speedup a part of my Python code that manipulates
python list objects. I do stg like:

void  Foo(numeric::array& X, numeric::array& Y, bool flag, list
max_points, list min_points,
		                    list left_max_points, list right_max_points){
    ...
    ...
    int Lmax =
boost::python::extract<int>(max_points.attr("__len__")());
    ...
    ...
}

It compiles, but it crashes with segmentation fault, at the line where I
try get the length of max_points, 
which is a list.

I don't understand why !

any help ?

Thanks in advance

Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20081030/69daa4fa/attachment.htm>


More information about the Cplusplus-sig mailing list