Python bindings - global functions

Consider the following global C++ function, defined and reflected in namespace ns:


// C++ code
namespace ns
{
    $function+ int32 sum(int32 x, int32 y)
    {
        return x + y;
    }
}

This global function can be called directly from Python like this:


# python code
print 'sum(1,2) = ' + `ns.sum(1,2)`

which produces the following output:


sum(1,2) = 3