[C++-sig] set python attribute from C++

Gennadiy Rozental rogeeff at gmail.com
Wed Jul 16 21:48:13 CEST 2008


Alex Mohr <amohr <at> pixar.com> writes:

> 
> > essentially I want something like this:
> > 
> > void foo( A& obj )
> > {
> >    boost::python::object o = get_py_object( obj );
> >    o.attr( "field" ) = 1;
> > }
> 
> Maybe something like this:
> 
> void foo(boost::python::object obj) {

This is really not an option. This function have to handle other types that are
not python related




More information about the Cplusplus-sig mailing list