@@ -255,7 +255,7 @@ \section{Intermezzo: Errors and Exceptions
255255should probably be \cdata {PyExc_IOError}). If something's wrong with
256256the argument list, the \cfunction {PyArg_ParseTuple()} function usually
257257raises \cdata {PyExc_TypeError}. If you have an argument whose value
258- which must be in a particular range or must satisfy other conditions,
258+ must be in a particular range or must satisfy other conditions,
259259\cdata {PyExc_ValueError} is appropriate.
260260
261261You can also define a new exception that is unique to your module.
@@ -380,7 +380,7 @@ \section{The Module's Method Table and Initialization Function
380380arguments should be passed to the function. In this case, the C
381381function should accept a third \samp {PyObject *} parameter which will
382382be a dictionary of keywords. Use \cfunction {PyArg_ParseTupleAndKeywords()}
383- to parse the arguemts to such a function.
383+ to parse the arguments to such a function.
384384
385385The method table must be passed to the interpreter in the module's
386386initialization function (which should be the only non-\code {static}
@@ -462,7 +462,7 @@ \section{Calling Python Functions from C
462462somehow pass you the Python function object. You should provide a
463463function (or some other interface) to do this. When this function is
464464called, save a pointer to the Python function object (be careful to
465- \cfunction {Py_INCREF()} it!) in a global variable --- or whereever you
465+ \cfunction {Py_INCREF()} it!) in a global variable --- or wherever you
466466see fit. For example, the following function might be part of a module
467467definition:
468468
@@ -719,7 +719,7 @@ \section{Format Strings for \cfunction{PyArg_ParseTuple()}
719719requested; however no proper range checking is done --- the most
720720significant bits are silently truncated when the receiving field is
721721too small to receive the value (actually, the semantics are inherited
722- from downcasts in C --- your milage may vary).
722+ from downcasts in C --- your mileage may vary).
723723
724724A few other characters have a meaning in a format string. These may
725725not occur inside nested parentheses. They are:
@@ -736,7 +736,7 @@ \section{Format Strings for \cfunction{PyArg_ParseTuple()}
736736\item [\samp {:}]
737737The list of format units ends here; the string after the colon is used
738738as the function name in error messages (the `` associated value'' of
739- the exceptions that \cfunction {PyArg_ParseTuple()} raises).
739+ the exception that \cfunction {PyArg_ParseTuple()} raises).
740740
741741\item [\samp {;}]
742742The list of format units ends here; the string after the colon is used
@@ -866,6 +866,10 @@ \section{Keyword Parsing with \cfunction{PyArg_ParseTupleAndKeywords()}
866866}
867867
868868static PyMethodDef keywdarg_methods[] = {
869+ /* The cast of the function is necessary since PyCFunction values
870+ * only take two PyObject* parameters, and keywdarg_parrot() takes
871+ * three.
872+ */
869873 {"parrot", (PyCFunction)keywdarg_parrot, METH_VARARGS|METH_KEYWORDS},
870874 {NULL, NULL} /* sentinel */
871875};
@@ -1605,9 +1609,9 @@ \chapter{Building C and \Cpp{} Extensions on \UNIX{}
16051609\end {verbatim }
16061610
16071611to indicate that the modules defined in \file {Setup} are to be built
1608- as dynamically-linked linked modules. A line containing only
1609- \samp {*static*} can be used to indicate the subsequently listed
1610- modules should be statically linked.
1612+ as dynamically linked modules. A line containing only \samp {*static*}
1613+ can be used to indicate the subsequently listed modules should be
1614+ statically linked.
16111615
16121616Here is a complete \file {Setup} file for building a
16131617\module {cPersistent} module:
@@ -1672,7 +1676,7 @@ \section{Module Definition Options \label{module-defn-options}}
16721676\end {tableii }
16731677
16741678Other compiler options can be included (snuck in) by putting them
1675- in variable variables.
1679+ in variables.
16761680
16771681Source files can include files with \file {.c}, \file {.C}, \file {.cc},
16781682\file {.cpp}, \file {.cxx}, and \file {.c++} extensions.
0 commit comments