Hi,<div><br></div><div>I&#39;m starting to explore the use of boost.python in cctbx. I&#39;ve written a simple C++ class and exposed its accessor methods as attributes using the .add_property syntax in the wrapper. In the C++ class my member data and accessor return types are, for example, scitbx::vec3&lt;double&gt;. When I access the attribute in Python with the usual dot operator I get a tuple. What I&#39;d really like though is an object of type &lt;class &#39;scitbx.matrix.col&#39;&gt;, which is what I passed to the constructor of the object in Python. So the conversion from Python to C++ does what I want, but not the other way round. How do I take control of the type of the attribute in Python, without having to explicitly construct a scitbx.matrix.col from the tuple? It&#39;s the same case if I use .def and expose the accessor as a method instead of an attribute.</div>

<div><br></div><div>I admit I don&#39;t fully understand the details of conversions in either direction. I found I had to add</div><div><br></div><div>from cctbx.array_family import flex</div><div><br></div><div>to the package __init__.py where my C++ extension is imported, so that I could pass scitbx.matrix.col objects (or scitbx.matrix.rec, or tuples) to the constructor in Python and not get a Boost.Python.ArgumentError. I&#39;ve not yet figured out what this import is doing though.</div>

<div><br></div><div>Apologies for the remedial question. These are still early days for me.</div><div><br></div><div>Thanks</div><div><br>-- David<br>
</div>