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
You’re currently reading “ How do I stop SWIG from rewrapping a handwrapped function? ,” an entry on Chui's Counterpoint
- Published:
- 8.31.12 / 2am
- Category:
- Python
Comments are closed
Comments are currently closed on this entry.