Content-Type: multipart/alternative; boundary=e0cb4e8878a52f33720483e629a4 --e0cb4e8878a52f33720483e629a4 Content-Type: text/plain; charset=ISO-8859-1 In cxx_extensions.cxx extern "C" PyObject *getattro_handler( PyObject *self, PyObject *name ) { try { PythonExtensionBase *p = getPythonExtensionBase( self ); return new_reference_to( p->getattro( Py::String( name ) ) ); } catch( Py::Exception &) { return NULL; // indicate error } } In a derived class this always call the getattro of the base class, and never get the derived class attributes visible. How can I access a derived class attro? I've attached the test system, base.h and base.cxx. When compiled, it is possible to create a g = base.Gain("b",1,None,2.43) object, and access name,number and parent attributes, but doesn't reach the gain attribute. Python says """Traceback (most recent call last): File "", line 1, in AttributeError: 'Gain' object has no attribute 'gain' """ It would be possible to call first the derived class method, and inside it call the base class method (under the user responsibility)? -- Fernando Libonati fernando.libonati at gmail.com --e0cb4e8878a52f33720483e629a4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable In cxx_extensions.cxx

extern "C" PyObject *getattro_handle= r( PyObject *self, PyObject *name )
{
=A0=A0=A0 try
=A0=A0=A0 {=A0=A0=A0=A0=A0=A0=A0 PythonExtensionBase *p =3D getPythonExtensionBase( s= elf );
=A0=A0=A0=A0=A0=A0=A0 return new_reference_to( p->getattro( Py= ::String( name ) ) );
=A0=A0=A0 }
=A0=A0=A0 catch( Py::Exception &)
=A0=A0=A0 {
=A0= =A0=A0=A0=A0=A0=A0 return NULL;=A0=A0=A0 // indicate error
=A0=A0=A0 }}

In a derived class this always call the getattro of the base cla= ss, and never get the derived class attributes visible.
How can I access a derived class attro?

I've attached the test s= ystem, base.h and base.cxx.
When compiled, it is possible to create a g = =3D base.Gain("b",1,None,2.43) object, and access name,number and= parent attributes, but doesn't reach the gain attribute.
Python says
"""Traceback (most recent call last):
=A0 = File "<stdin>", line 1, in <module>
AttributeError= : 'Gain' object has no attribute 'gain'
""&quo= t;

It would be possible to call first the derived class method, and inside= it call the base class method (under the user responsibility)?

-- <= br>Fernando Libonati
fernando.libonati at g= mail.com
--e0cb4e8878a52f33720483e629a4--