homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sandro.tosi
Recipients docs@python, sandro.tosi
Date 2012年08月14日.18:57:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1344970665.85.0.951420699824.issue15656@psf.upfronthosting.co.za>
In-reply-to
Content
Hello,
this has been reported at http://mail.python.org/pipermail/docs/2012-July/009223.html but since I have no experience to judge if it's correct or not, i'll just report it:
>>>
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-parameters-for-extension-functions),
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).
<<<
History
Date User Action Args
2012年08月14日 18:57:45sandro.tosisetrecipients: + sandro.tosi, docs@python
2012年08月14日 18:57:45sandro.tosisetmessageid: <1344970665.85.0.951420699824.issue15656@psf.upfronthosting.co.za>
2012年08月14日 18:57:45sandro.tosilinkissue15656 messages
2012年08月14日 18:57:44sandro.tosicreate

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