The __doc__ string for the whole module can be set at module
initialization time by calling initmodule4() (Py_InitModule4() in the
new naming scheme) instead of initmodule() (Py_InitModule()).
The __doc__ string for individual functions and methods can be set as
the 4th element of the struct methodlist (PyMethodDef) initializer.
See Modules/newmodule.c for an example (still in the old naming
scheme).
Or were you thinking of a higher level facility, such as automatic
comment processing?
--Guido van Rossum, CWI, Amsterdam <mailto:Guido.van.Rossum@cwi.nl>
<http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>