tring_from_python_str();

    def(&quot;hello&quot;, hello);
    def(&quot;size&quot;, size);
  }

}} // namespace sandbox::&lt;anonymous&gt;

BOOST_PYTHON_MODULE(custom_string)
{
  sandbox::init_module();
}</pre>

    <hr>
    <h2><a name="topythonconversionfailed"></a
    >Why is my automatic to-python conversion not being found?</h2>
    <font size="-1"><i>Niall Douglas provides these notes:</i></font><p>
    If you define custom converters similar to the ones
    shown above the <tt>def_readonly()</tt> 