Is there something wrong with this, which looks simpler to my (naive) eyes?: struct A {}; struct B { B (A& _a) : a (_a) {} A& a; }; static A& getA (B& b) { return b.a; } BOOST_PYTHON_MODULE(demod4) { class_<A> ("A"); class_<B> ("B", init<A&>() [with_custodian_and_ward<1,2>()]) .def ("getA", &::getA, return_internal_reference<>()) ; }