[C++-sig] problem chaning object state using a python class that inherits from c++ class
dave at boost-consulting.com
Tue Aug 16 21:44:41 CEST 2005
"Alexis H. Rivera-Rios" <ahrivera at yahoo.com> writes:
> Im sending the email again, since I don't remember if
> I have send it or not. Please forgive the formatting
> since I don't know how to control that with yahoo
THe formatting is okay, but...
> Here is the pyste script
> B = Class("B","test.h")
> D = Class("D","test.h")
Sorry, but I don't know Jack about pyste, so please show me the code
it generates instead.
> Here is an example of the error:
> (test 1) works as expected
And please don't show me anything that works as expected. That's just
a distraction from the problem.
> (test 2) fails when called from C
>>>> class E(B):
> ... def Update(self,data,val):
> ... data.a = 999
> ... data.b = 100
>>>> e = E()
>>>> cc = C()
>>>> print cc.GetData_a()
>>>> print cc.GetData_b()
Please show me the result you were expecting, like I asked you to.
I'm guessing it was 999 and 100.0 ??
> Hope this illustrates the problem better,
Sorta. This example could be smaller, couldn't it? Do you really
need two data members to show it?
I really mean it: if you pare it down to the absolute minimum you'll
probably find the problem yourself.
More information about the Cplusplus-sig