Small error in the "Extending Python with C" page

Hello, I've recenty started to try using C code in python using the wonderful python API, although i have to say the learning curve was non neglectable :P I've spotted what I believe to be a small mistake in the documentation from this page: http://docs.python.org/release/3.2/extending/extending.html In paragraph 1.8 (http://docs.python.org/release/3.2/extending/extending.html#keyword-paramete...), the code example given contains an error, which is actually obsolete code from python 2.7: void initkeywdarg(void) { /* Create the module and add the functions */ Py_InitModule("keywdarg", keywdarg_methods); } This doesn't work in Python3.2. It's supposed to be static struct PyModuleDef keywdargmodule = { PyModuleDef_HEAD_INIT, "keywdarg", /* name of module */ keywdarg_doc, /* module documentation, may be NULL */ -1, /* size of per-interpreter state of the module, or -1 if the module keeps state in global variables. */ keywdarg_methods }; PyMODINIT_FUNC PyInit_keywdarg(void) { return PyModule_Create(&keywdargmodule); } As explained above (and confirmed by experience). Thanks for your work, Hadrien.

Hello Hadrien, given I have no experience nor knowledge to judge the correctness of your proposed fix, I've just reported http://bugs.python.org/issue15656 . Regards, Sandro On Sat, Jul 7, 2012 at 2:35 PM, Hadrien Titeux <hadwarez@gmail.com> wrote:
-- Sandro Tosi (aka morph, morpheus, matrixhasu) My website: http://matrixhasu.altervista.org/ Me at Debian: http://wiki.debian.org/SandroTosi

Hello Hadrien, given I have no experience nor knowledge to judge the correctness of your proposed fix, I've just reported http://bugs.python.org/issue15656 . Regards, Sandro On Sat, Jul 7, 2012 at 2:35 PM, Hadrien Titeux <hadwarez@gmail.com> wrote:
-- Sandro Tosi (aka morph, morpheus, matrixhasu) My website: http://matrixhasu.altervista.org/ Me at Debian: http://wiki.debian.org/SandroTosi
participants (2)
-
Hadrien Titeux
-
Sandro Tosi