changeset: 78587:599376deeeac branch: 3.2 parent: 78580:7590dec388a7 user: Eli Bendersky date: Wed Aug 15 14:49:49 2012 +0300 files: Doc/extending/extending.rst description: Issue #15656: fixing code sample in extending doc diff -r 7590dec388a7 -r 599376deeeac Doc/extending/extending.rst --- a/Doc/extending/extending.rst Tue Aug 14 21:40:13 2012 -0400 +++ b/Doc/extending/extending.rst Wed Aug 15 14:49:49 2012 +0300 @@ -735,13 +735,18 @@ {NULL, NULL, 0, NULL} /* sentinel */ }; -:: + static struct PyModuleDef keywdargmodule = { + PyModuleDef_HEAD_INIT, + "keywdarg", + NULL, + -1, + keywdarg_methods + }; - void - initkeywdarg(void) + PyMODINIT_FUNC + PyInit_keywdarg(void) { - /* Create the module and add the functions */ - Py_InitModule("keywdarg", keywdarg_methods); + return PyModule_Create(&keywdargmodule); }

AltStyle によって変換されたページ (->オリジナル) /