mirror of
https://github.com/python/cpython.git
synced 2025-08-02 08:02:56 +00:00
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 <crum@dev-group.com>.
This commit is contained in:
parent
cf3ba65749
commit
2d54523551
1 changed files with 10 additions and 7 deletions
|
@ -379,15 +379,18 @@ the Python-level parameters to be passed in as a tuple acceptable for
|
||||||
parsing via \cfunction{PyArg_ParseTuple()}; more information on this
|
parsing via \cfunction{PyArg_ParseTuple()}; more information on this
|
||||||
function is provided below.
|
function is provided below.
|
||||||
|
|
||||||
The \constant{METH_KEYWORDS} bit may be set in the third field if keyword
|
The \constant{METH_KEYWORDS} bit may be set in the third field if
|
||||||
arguments should be passed to the function. In this case, the C
|
keyword arguments should be passed to the function. In this case, the
|
||||||
function should accept a third \samp{PyObject *} parameter which will
|
C function should accept a third \samp{PyObject *} parameter which
|
||||||
be a dictionary of keywords. Use \cfunction{PyArg_ParseTupleAndKeywords()}
|
will be a dictionary of keywords. Use
|
||||||
to parse the arguments to such a function.
|
\cfunction{PyArg_ParseTupleAndKeywords()} to parse the arguments to
|
||||||
|
such a function.
|
||||||
|
|
||||||
The method table must be passed to the interpreter in the module's
|
The method table must be passed to the interpreter in the module's
|
||||||
initialization function (which should be the only non-\code{static}
|
initialization function. The initialization function must be named
|
||||||
item defined in the module file):
|
\cfunction{init\var{name}()}, where \var{name} is the name of the
|
||||||
|
module, and should be the only non-\keyword{static} item defined in
|
||||||
|
the module file:
|
||||||
|
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
void
|
void
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue