How do I stop SWIG from rewrapping a handwrapped function?

To tell SWIG that a function has already been manually wrapped, and to not rewrap it again, instead to just insert the name of method as-is to the method definitions, use the %native(yourfunc)

%module "test"

/* Prototype */    
%native(DontWrapMeBro)
PyObject* DontWrapMeBro(PyObject* self, PyObject* args);

%{
  PyObject* DontWrapMeBro(PyObject* self, PyObject* args)
  {
    return PyString_AsString("Don't wrap me");
  }
%}


About this entry