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

David Abrahams dave at boostpro.com
Thu Oct 30 14:13:51 CET 2008


Looks like you have a bug somewhere else. Trying to reduce this to a  
minimal reproducible case will doubtless help you find it.

Sent from my iPhone

On Oct 30, 2008, at 5:38 AM, christophe grimault <christophe.grimault at novagrid.com 
 > wrote:

> 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
> _______________________________________________
> Cplusplus-sig mailing list
> Cplusplus-sig at python.org
> http://mail.python.org/mailman/listinfo/cplusplus-sig


More information about the Cplusplus-sig mailing list