mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Jim Fulton's change to support doc strings
This commit is contained in:
parent
1e054024c1
commit
9a69112f85
5 changed files with 30 additions and 4 deletions
|
@ -1,4 +1,8 @@
|
|||
|
||||
static char $abbrev$_$method$__doc__[] =
|
||||
""
|
||||
;
|
||||
|
||||
static PyObject *
|
||||
$abbrev$_$method$(self, args)
|
||||
PyObject *self; /* Not used */
|
||||
|
|
|
@ -9,13 +9,19 @@ static struct PyMethodDef $abbrev$_methods[] = {
|
|||
|
||||
/* Initialization function for the module (*must* be called init$name$) */
|
||||
|
||||
static char $name$_module_documentation[] =
|
||||
""
|
||||
;
|
||||
|
||||
void
|
||||
init$name$()
|
||||
{
|
||||
PyObject *m, *d;
|
||||
|
||||
/* Create the module and add the functions */
|
||||
m = Py_InitModule("$name$", $abbrev$_methods);
|
||||
m = Py_InitModule4("$name$", $abbrev$_methods,
|
||||
$name$_module_documentation,
|
||||
(PyObject*)NULL,PYTHON_API_VERSION);
|
||||
|
||||
/* Add some symbolic constants to the module */
|
||||
d = PyModule_GetDict(m);
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
|
||||
static char $abbrev$_$method$__doc__[] =
|
||||
""
|
||||
;
|
||||
|
||||
static PyObject *
|
||||
$abbrev$_$method$(self, args)
|
||||
$abbrev$object *self;
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
|
||||
static char $Abbrev$type__doc__[] =
|
||||
""
|
||||
;
|
||||
|
||||
static PyTypeObject $Abbrev$type = {
|
||||
PyObject_HEAD_INIT(&PyType_Type)
|
||||
0, /*ob_size*/
|
||||
|
@ -16,6 +20,12 @@ static PyTypeObject $Abbrev$type = {
|
|||
$tp_as_sequence$, /*tp_as_sequence*/
|
||||
$tp_as_mapping$, /*tp_as_mapping*/
|
||||
(hashfunc)$tp_hash$, /*tp_hash*/
|
||||
(binaryfunc)$tp_call$, /*tp_call*/
|
||||
(reprfunc)$tp_str$, /*tp_str*/
|
||||
|
||||
/* Space for future expansion */
|
||||
0L,0L,0L,0L,
|
||||
$Abbrev$type__doc__ /* Documentation string */
|
||||
};
|
||||
|
||||
/* End of code for $name$ objects */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue