nit&lt;int&gt;())
   ...
   ;
</pre>
    Of course, if X has no virtual functions you'll have to use
    <code>static_cast</code> instead of <code>dynamic_cast</code> with no
    runtime check that it's valid. This approach also only works if the
    <code>X</code> object was constructed from Python, because
    <code>X</code>s constructed from C++ are of course never
    <code>X_wrap</code> objects.

    <p>Another approach to this requires you to change your C++ code a bit;
    if that's an option for you