Initializing Cython objects with existing C Objects
问题 C++ Model Say I have the following C++ data structures I wish to expose to Python. #include <memory> #include <vector> struct mystruct { int a, b, c, d, e, f, g, h, i, j, k, l, m; }; typedef std::vector<std::shared_ptr<mystruct>> mystruct_list; Boost Python I can wrap these fairly effectively using boost::python with the following code, easily allowing me to use the existing mystruct (copying the shared_ptr) rather than recreating an existing object. #include "mystruct.h" #include <boost