Skip to content

Instantly share code, notes, and snippets.

@oliora
oliora / something.i
Created September 3, 2012 08:08
SWIG interface with using of Python callable as callback
%module(threads="1") something
%{
// Register a callback (called from Python code)
// callbackFunc is a Python callable accepting one argument
void registerHandler(PyObject *callbackFunc)
{
SWIG_PYTHON_THREAD_BEGIN_ALLOW;
const bool hasCallback =