Documenting extension modules?

Simon Dahlbacka simon.dahlbacka at gmail.com
Fri Jul 15 08:04:47 EDT 2005


Re: assigning a PyStr object to __doc__, take a look at Py_InitModule3,
which does that for you.

Then you have the PyDoc_STRVAR macro in python.h that you might want to
use (see definition below). But as Robert already told you, you'll need
to provide the necessary information about i.e. parameters yourself in
the docstrings.

/* Define macros for inline documentation. */
#define PyDoc_VAR(name) static char name[]
#define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str)
#ifdef WITH_DOC_STRINGS
#define PyDoc_STR(str) str
#else
#define PyDoc_STR(str) ""
#endif




More information about the Python-list mailing list