I have a Data struct that looks like this
AckCmd(int ack, int error, std::string result);
AckCmd::AckCmd(int ack, int error, std::string result)
ackData.ack = ack;
ackData.error = error;
ackData.result = result;
I then am binding it as follows
py::class_<AckCmd>(m,"AckCmd", py::module_local(), py::dynamic_attr())
.def(py::init<int, int, const std::string &>())
I have the `py::module_local()` tag because I was getting an `ImportError: generic_type: type "*" is already registered!` error.
I have the `py::dynamic_attr()` tag to set the `ack`, `error` and `result` attributes of the ackData object.
However, when I enter the following within a python shell
>>> import SALPY_Library
>>> myAck = SALPY_Library.AckCmd( 1, 2, "myack")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'SALPY_Scheduler.AckCmd' object has no attribute 'ack'
The attributes are not there. When using double tabbing to view the attributes of the object it doesn't show any of the attributes from the c++ struct.
myAck._class( myAck.doc myAck.getattribute( myAck.init_subclass( myAck.ne( myAck.repr( myAck.subclasshook_(
myAck._delattr( myAck.eq( myAck.gt( myAck.le( myAck.new( myAck.setattr_(
myAck._dict myAck.format( myAck.hash( myAck.lt( myAck.reduce( myAck.sizeof_(
myAck._dir( myAck.ge( myAck.init( myAck.module myAck.reduce_ex( myAck.str_(