title: Boost.Serialization and Boost.Python two-way pickle
body: <p>I have a C++ library that uses Boost.Serialization. I'm creating Python bindings for this library using Boost.Python. It's fairly clear how to make a pickle suite for Boost.Python that uses Boost.Serialization (save to a string using Boost.Serialization, and return that string to Python).</p>
  
  <p>What I want is the reverse: given a <code>boost::python::object</code>, I want to have a <code>serialize(...)</code> function that would call Python's <code>pickle.dumps()</code> function and serialize the resulting string. (Imagine an <code>std::vector&lt;boost::python::object&gt;</code>. As I serialize this vector, Boost.Serialization would call the auxiliary <code>serialize()</code> function.)  Is this possible? Better yet, is it possible to use <code>cPickle</code> and bypass giving the control to the Python interpreter?</p>