Combining PyMethodDef's to create one C module

Pete Shinners pete at visionart.com
Wed Jul 12 21:29:42 EDT 2000


i've got a python extension in the works. the extension is
split into two main C source files. i figured it would be
easiest if each file has its own "PyMethodDef". then
combine both these lists when creating the module with 
"Py_InitModule"

I have not been able to find an easy way to combine these
lists to create the new module. i was hoping there would
be something like "PyModule_Append(PyObject*, PyMethodDef*)"

Is there some way i can add the functions from one 
PyMethodDef into the other by getting the first one's
dictionary, then adding the functions from the other one
one-by-one?
i think i could do this easy enough, but if someone could
show me the code to take a function pointer and __doc__
string and combine them into a callable PyObject it would
give me a BIG head start.



More information about the Python-list mailing list