The issue from Gitter
Reproducible example code
#include "pybind11/pybind11.h"
namespace py = pybind11;
struct BaseNonPolymorphic {
unsigned int a;
unsigned int b;
unsigned int c;
unsigned int d;
};
struct Derived : BaseNonPolymorphic {
Derived() {
a = 1;
b = 2;
c = 3;
d = 4;
};
virtual ~Derived() {};
};
PYBIND11_MODULE(test_inheritance, m) {
py::class_<BaseNonPolymorphic > base_class(m, "Base");
base_class
.def_readwrite("d", &BaseNonPolymorphic::d)
;
py::class_<Derived> derived_class(m, "Derived", base_class);
derived_class
.def(py::init<>())
;
}
import test_inheritance
derived_instance = test_inheritance.Derived()
assert derived_instance.d == 4