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

Skip to content

Commit 2d54523

Browse files
committed
Section "The Module's Method Table and Initialization Function":
Explain that the name of the initialization function must be init<module>(). Omission noted by Daniel Kozan <[email protected]>.
1 parent cf3ba65 commit 2d54523

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

Doc/ext/ext.tex

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -379,15 +379,18 @@ \section{The Module's Method Table and Initialization Function
379379
parsing via \cfunction{PyArg_ParseTuple()}; more information on this
380380
function is provided below.
381381

382-
The \constant{METH_KEYWORDS} bit may be set in the third field if keyword
383-
arguments should be passed to the function. In this case, the C
384-
function should accept a third \samp{PyObject *} parameter which will
385-
be a dictionary of keywords. Use \cfunction{PyArg_ParseTupleAndKeywords()}
386-
to parse the arguments to such a function.
382+
The \constant{METH_KEYWORDS} bit may be set in the third field if
383+
keyword arguments should be passed to the function. In this case, the
384+
C function should accept a third \samp{PyObject *} parameter which
385+
will be a dictionary of keywords. Use
386+
\cfunction{PyArg_ParseTupleAndKeywords()} to parse the arguments to
387+
such a function.
387388

388389
The method table must be passed to the interpreter in the module's
389-
initialization function (which should be the only non-\code{static}
390-
item defined in the module file):
390+
initialization function. The initialization function must be named
391+
\cfunction{init\var{name}()}, where \var{name} is the name of the
392+
module, and should be the only non-\keyword{static} item defined in
393+
the module file:
391394

392395
\begin{verbatim}
393396
void

0 commit comments

Comments
 (0)