t this you'd have to be able to change the C++ code you're wrapping
    so that it deals with shared_ptr instead of raw pointers.</p>

    <p>There are other approaches too. The functions that receive the Python
    object that you eventually want to return could be wrapped with a thin
    wrapper that records the correspondence between the object address and
    its containing Python object, and you could have your f_wrap function
    look in that mapping to get the Python object out.</p>

    <hr>

    <h