> And since things work for a single method when I declare 'def' as > 'static', I suspect that means that the function object created by > PyCFunction_NewEx holds on to a pointer to the PyMethodDef structure?
Correct; it doesn't make a copy of the struct. So when you want the function object to outlive the setRoutine call, you need to allocate the PyMethodDef on the heap. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list