A few minutes after this post, I've realized that Block::init_type() must be called in module initialization, and not in Gain::init_type(), but the same thing happens.
---------- Forwarded message ----------
From: Fernando Libonati <email@example.com>
Subject: Derived class getattro
To: Discuss PyCXX use and improvement <firstname.lastname@example.org
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.
"""Traceback (most recent call last):
File "<stdin>", line 1, in <module>
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 at gmail.com