Commit 5566c1ce authored by Fred Drake's avatar Fred Drake

Fixed a bunch of typos caught by Gilles Civario.

parent 0fe5af9b
...@@ -888,7 +888,7 @@ You need not increment its reference count. ...@@ -888,7 +888,7 @@ You need not increment its reference count.
const char *format, \moreargs} const char *format, \moreargs}
This function sets the error indicator. \var{exception} should be a This function sets the error indicator. \var{exception} should be a
Python exception (string or class, not an instance). Python exception (string or class, not an instance).
\var{fmt} should be a string, containing format codes, similar to \var{format} should be a string, containing format codes, similar to
\cfunction{printf}. The \code{width.precision} before a format code \cfunction{printf}. The \code{width.precision} before a format code
is parsed, but the width part is ignored. is parsed, but the width part is ignored.
...@@ -947,7 +947,7 @@ argument. It is mostly for internal use. ...@@ -947,7 +947,7 @@ argument. It is mostly for internal use.
\begin{cfuncdesc}{int}{PyErr_Warn}{PyObject *category, char *message} \begin{cfuncdesc}{int}{PyErr_Warn}{PyObject *category, char *message}
Issue a warning message. The \var{category} argument is a warning Issue a warning message. The \var{category} argument is a warning
category (see below) or NULL; the \var{message} argument is a message category (see below) or \NULL; the \var{message} argument is a message
string. string.
This function normally prints a warning message to \var{sys.stderr}; This function normally prints a warning message to \var{sys.stderr};
...@@ -960,8 +960,9 @@ return value is \code{0} if no exception is raised, or \code{-1} if ...@@ -960,8 +960,9 @@ return value is \code{0} if no exception is raised, or \code{-1} if
an exception is raised. (It is not possible to determine whether a an exception is raised. (It is not possible to determine whether a
warning message is actually printed, nor what the reason is for the warning message is actually printed, nor what the reason is for the
exception; this is intentional.) If an exception is raised, the exception; this is intentional.) If an exception is raised, the
caller should do its normal exception handling (e.g. DECREF owned caller should do its normal exception handling
references and return an error value). (e.g. \cfunction{Py_DECREF()} owned references and return an error
value).
Warning categories must be subclasses of \cdata{Warning}; the default Warning categories must be subclasses of \cdata{Warning}; the default
warning category is \cdata{RuntimeWarning}. The standard Python warning category is \cdata{RuntimeWarning}. The standard Python
...@@ -1104,7 +1105,7 @@ Return true (nonzero) if the standard I/O file \var{fp} with name ...@@ -1104,7 +1105,7 @@ Return true (nonzero) if the standard I/O file \var{fp} with name
\var{filename} is deemed interactive. This is the case for files for \var{filename} is deemed interactive. This is the case for files for
which \samp{isatty(fileno(\var{fp}))} is true. If the global flag which \samp{isatty(fileno(\var{fp}))} is true. If the global flag
\cdata{Py_InteractiveFlag} is true, this function also returns true if \cdata{Py_InteractiveFlag} is true, this function also returns true if
the \var{name} pointer is \NULL{} or if the name is equal to one of the \var{filename} pointer is \NULL{} or if the name is equal to one of
the strings \code{'<stdin>'} or \code{'???'}. the strings \code{'<stdin>'} or \code{'???'}.
\end{cfuncdesc} \end{cfuncdesc}
...@@ -1497,22 +1498,24 @@ Call a callable Python object \var{callable_object}, with ...@@ -1497,22 +1498,24 @@ Call a callable Python object \var{callable_object}, with
arguments given by the tuple \var{args}. If no arguments are arguments given by the tuple \var{args}. If no arguments are
needed, then \var{args} may be \NULL{}. Returns the result of the needed, then \var{args} may be \NULL{}. Returns the result of the
call on success, or \NULL{} on failure. This is the equivalent call on success, or \NULL{} on failure. This is the equivalent
of the Python expression \samp{apply(\var{o}, \var{args})}. of the Python expression \samp{apply(\var{callable_object}, \var{args})}.
\bifuncindex{apply} \bifuncindex{apply}
\end{cfuncdesc} \end{cfuncdesc}
\begin{cfuncdesc}{PyObject*}{PyObject_CallFunction}{PyObject *callable_object, char *format, ...} \begin{cfuncdesc}{PyObject*}{PyObject_CallFunction}{PyObject *callable_object,
char *format, ...}
Call a callable Python object \var{callable_object}, with a Call a callable Python object \var{callable_object}, with a
variable number of C arguments. The C arguments are described variable number of C arguments. The C arguments are described
using a \cfunction{Py_BuildValue()} style format string. The format may using a \cfunction{Py_BuildValue()} style format string. The format may
be \NULL{}, indicating that no arguments are provided. Returns the be \NULL{}, indicating that no arguments are provided. Returns the
result of the call on success, or \NULL{} on failure. This is result of the call on success, or \NULL{} on failure. This is
the equivalent of the Python expression \samp{apply(\var{o}, the equivalent of the Python expression \samp{apply(\var{callable_object},
\var{args})}.\bifuncindex{apply} \var{args})}.\bifuncindex{apply}
\end{cfuncdesc} \end{cfuncdesc}
\begin{cfuncdesc}{PyObject*}{PyObject_CallMethod}{PyObject *o, char *m, char *format, ...} \begin{cfuncdesc}{PyObject*}{PyObject_CallMethod}{PyObject *o,
char *method, char *format, ...}
Call the method named \var{m} of object \var{o} with a variable number Call the method named \var{m} of object \var{o} with a variable number
of C arguments. The C arguments are described by a of C arguments. The C arguments are described by a
\cfunction{Py_BuildValue()} format string. The format may be \NULL{}, \cfunction{Py_BuildValue()} format string. The format may be \NULL{},
...@@ -1687,7 +1690,7 @@ expression \samp{\var{o1} >> \var{o2}}. ...@@ -1687,7 +1690,7 @@ expression \samp{\var{o1} >> \var{o2}}.
\begin{cfuncdesc}{PyObject*}{PyNumber_And}{PyObject *o1, PyObject *o2} \begin{cfuncdesc}{PyObject*}{PyNumber_And}{PyObject *o1, PyObject *o2}
Returns the ``bitwise and'' of \var{o2} and \var{o2} on success and Returns the ``bitwise and'' of \var{o2} and \var{o2} on success and
\NULL{} on failure. This is the equivalent of the Python expression \NULL{} on failure. This is the equivalent of the Python expression
\samp{\var{o1} \& \var{o2}}. \samp{\var{o1} \&\ \var{o2}}.
\end{cfuncdesc} \end{cfuncdesc}
...@@ -1745,7 +1748,7 @@ See the built-in function \function{pow()}\bifuncindex{pow}. Returns ...@@ -1745,7 +1748,7 @@ See the built-in function \function{pow()}\bifuncindex{pow}. Returns
\NULL{} on failure. The operation is done \emph{in-place} when \var{o1} \NULL{} on failure. The operation is done \emph{in-place} when \var{o1}
supports it. This is the equivalent of the Python expression \samp{\var{o1} supports it. This is the equivalent of the Python expression \samp{\var{o1}
**= \var{o2}} when o3 is \cdata{Py_None}, or an in-place variant of **= \var{o2}} when o3 is \cdata{Py_None}, or an in-place variant of
\samp{pow(\var{o1}, \var{o2}, var{o3})} otherwise. If \var{o3} is to be \samp{pow(\var{o1}, \var{o2}, \var{o3})} otherwise. If \var{o3} is to be
ignored, pass \cdata{Py_None} in its place (passing \NULL{} for \var{o3} ignored, pass \cdata{Py_None} in its place (passing \NULL{} for \var{o3}
would cause an illegal memory access). would cause an illegal memory access).
\end{cfuncdesc} \end{cfuncdesc}
...@@ -1767,10 +1770,10 @@ supports it. This is the equivalent of the Python expression \samp{\var{o1} ...@@ -1767,10 +1770,10 @@ supports it. This is the equivalent of the Python expression \samp{\var{o1}
\begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceAnd}{PyObject *o1, PyObject *o2} \begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceAnd}{PyObject *o1, PyObject *o2}
Returns the ``bitwise and'' of \var{o2} and \var{o2} on success Returns the ``bitwise and'' of \var{o1} and \var{o2} on success
and \NULL{} on failure. The operation is done \emph{in-place} when \var{o1} and \NULL{} on failure. The operation is done \emph{in-place} when
supports it. This is the equivalent of the Python expression \samp{\var{o1} \var{o1} supports it. This is the equivalent of the Python expression
\&= \var{o2}}. \samp{\var{o1} \&= \var{o2}}.
\end{cfuncdesc} \end{cfuncdesc}
...@@ -1883,7 +1886,7 @@ statement \samp{\var{o}[\var{i}] = \var{v}}. ...@@ -1883,7 +1886,7 @@ statement \samp{\var{o}[\var{i}] = \var{v}}.
\end{cfuncdesc} \end{cfuncdesc}
\begin{cfuncdesc}{int}{PySequence_DelItem}{PyObject *o, int i} \begin{cfuncdesc}{int}{PySequence_DelItem}{PyObject *o, int i}
Delete the \var{i}th element of object \var{v}. Returns Delete the \var{i}th element of object \var{o}. Returns
\code{-1} on failure. This is the equivalent of the Python \code{-1} on failure. This is the equivalent of the Python
statement \samp{del \var{o}[\var{i}]}. statement \samp{del \var{o}[\var{i}]}.
\end{cfuncdesc} \end{cfuncdesc}
...@@ -2043,7 +2046,7 @@ The functions in this chapter are specific to certain Python object ...@@ -2043,7 +2046,7 @@ The functions in this chapter are specific to certain Python object
types. Passing them an object of the wrong type is not a good idea; types. Passing them an object of the wrong type is not a good idea;
if you receive an object from a Python program and you are not sure if you receive an object from a Python program and you are not sure
that it has the right type, you must perform a type check first; that it has the right type, you must perform a type check first;
for example. to check that an object is a dictionary, use for example, to check that an object is a dictionary, use
\cfunction{PyDict_Check()}. The chapter is structured like the \cfunction{PyDict_Check()}. The chapter is structured like the
``family tree'' of Python object types. ``family tree'' of Python object types.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment