Re: [C++-sig] Re : changing argument value in a C++/Python code

2012-06-08 Thread Stefan Seefeld
Christoph, your C++ code passes a pointer argument to the "g()" member function, but your Python bindings don't specify a call policy. (I wonder why that doesn't raise a compilation error.) The effect mostly likely is that in fact the value is copied, so you see a new object. Explicit is better t

Re: [C++-sig] Re : changing argument value in a C++/Python code

2012-06-08 Thread Nat Linden
On Fri, Jun 8, 2012 at 8:46 AM, christophe jean-joseph wrote: > class C > { > public: > double myC; > C(){} > ~C(){} > > void setValue(double val) { > myC = val; >     } > >     double getValue() { > return myC; >     } > }; > ... > > class A > { > public: > ... > C h(){ //This function wont be o