Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ed3e09f

Browse files
committed
Add a docstring to the module type.
1 parent 2e4e026 commit ed3e09f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Objects/moduleobject.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,12 @@ module_traverse(PyModuleObject *m, visitproc visit, void *arg)
209209
return 0;
210210
}
211211

212+
static char module_doc[] =
213+
"module(name[, doc])\n\
214+
\n\
215+
Create a module object.\n\
216+
The name must be a string; the optional doc argument can have any type.";
217+
212218
PyTypeObject PyModule_Type = {
213219
PyObject_HEAD_INIT(&PyType_Type)
214220
0, /* ob_size */
@@ -232,7 +238,7 @@ PyTypeObject PyModule_Type = {
232238
0, /* tp_as_buffer */
233239
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
234240
Py_TPFLAGS_BASETYPE, /* tp_flags */
235-
0, /* tp_doc */
241+
module_doc, /* tp_doc */
236242
(traverseproc)module_traverse, /* tp_traverse */
237243
0, /* tp_clear */
238244
0, /* tp_richcompare */

0 commit comments

Comments
 (0)