mirror of
https://github.com/python/cpython.git
synced 2025-11-13 15:40:05 +00:00
Thomas Wouters <thomas@xs4all.net>:
Fix up some of the PyNumber_*() documentation. Add documentation for the InPlace API calls.
This commit is contained in:
parent
9c940ca143
commit
7740a01096
1 changed files with 106 additions and 7 deletions
113
Doc/api/api.tex
113
Doc/api/api.tex
|
|
@ -1625,22 +1625,107 @@ 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 result of ``anding'' \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
|
\NULL{} on failure. This is the equivalent of the Python expression
|
||||||
expression \samp{\var{o1} and \var{o2}}.
|
\samp{\var{o1} \& \var{o2}}.
|
||||||
\end{cfuncdesc}
|
\end{cfuncdesc}
|
||||||
|
|
||||||
|
|
||||||
\begin{cfuncdesc}{PyObject*}{PyNumber_Xor}{PyObject *o1, PyObject *o2}
|
\begin{cfuncdesc}{PyObject*}{PyNumber_Xor}{PyObject *o1, PyObject *o2}
|
||||||
Returns the bitwise exclusive or of \var{o1} by \var{o2} on success,
|
Returns the ``bitwise exclusive or'' of \var{o1} by \var{o2} on success,
|
||||||
or \NULL{} on failure. This is the equivalent of the Python
|
or \NULL{} on failure. This is the equivalent of the Python
|
||||||
expression \samp{\var{o1} \^{ }\var{o2}}.
|
expression \samp{\var{o1} \^{ }\var{o2}}.
|
||||||
\end{cfuncdesc}
|
\end{cfuncdesc}
|
||||||
|
|
||||||
\begin{cfuncdesc}{PyObject*}{PyNumber_Or}{PyObject *o1, PyObject *o2}
|
\begin{cfuncdesc}{PyObject*}{PyNumber_Or}{PyObject *o1, PyObject *o2}
|
||||||
Returns the result of \var{o1} and \var{o2} on success, or \NULL{} on
|
Returns the ``bitwise or'' of \var{o1} and \var{o2} on success, or
|
||||||
failure. This is the equivalent of the Python expression
|
\NULL{} on failure. This is the equivalent of the Python expression
|
||||||
\samp{\var{o1} or \var{o2}}.
|
\samp{\var{o1} | \var{o2}}.
|
||||||
|
\end{cfuncdesc}
|
||||||
|
|
||||||
|
|
||||||
|
\begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceAdd}{PyObject *o1, PyObject *o2}
|
||||||
|
Returns the result of adding \var{o1} and \var{o2}, or \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} += \var{o2}}.
|
||||||
|
\end{cfuncdesc}
|
||||||
|
|
||||||
|
|
||||||
|
\begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceSubtract}{PyObject *o1, PyObject *o2}
|
||||||
|
Returns the result of subtracting \var{o2} from \var{o1}, or
|
||||||
|
\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}
|
||||||
|
-= \var{o2}}.
|
||||||
|
\end{cfuncdesc}
|
||||||
|
|
||||||
|
|
||||||
|
\begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceMultiply}{PyObject *o1, PyObject *o2}
|
||||||
|
Returns the result of multiplying \var{o1} and \var{o2}, or \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} *= \var{o2}}.
|
||||||
|
\end{cfuncdesc}
|
||||||
|
|
||||||
|
|
||||||
|
\begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceDivide}{PyObject *o1, PyObject *o2}
|
||||||
|
Returns the result of dividing \var{o1} by \var{o2}, or \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} /= \var{o2}}.
|
||||||
|
\end{cfuncdesc}
|
||||||
|
|
||||||
|
|
||||||
|
\begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceRemainder}{PyObject *o1, PyObject *o2}
|
||||||
|
Returns the remainder of dividing \var{o1} by \var{o2}, or \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} \%= \var{o2}}.
|
||||||
|
\end{cfuncdesc}
|
||||||
|
|
||||||
|
|
||||||
|
\begin{cfuncdesc}{PyObject*}{PyNumber_InPlacePower}{PyObject *o1, PyObject *o2, PyObject *o3}
|
||||||
|
See the built-in function \function{pow()}\bifuncindex{pow}. Returns
|
||||||
|
\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}
|
||||||
|
**= \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
|
||||||
|
ignored, pass \cdata{Py_None} in its place (passing \NULL{} for \var{o3}
|
||||||
|
would cause an illegal memory access).
|
||||||
|
\end{cfuncdesc}
|
||||||
|
|
||||||
|
\begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceLshift}{PyObject *o1, PyObject *o2}
|
||||||
|
Returns the result of left shifting \var{o1} by \var{o2} on success, or
|
||||||
|
\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}
|
||||||
|
<<= \var{o2}}.
|
||||||
|
\end{cfuncdesc}
|
||||||
|
|
||||||
|
|
||||||
|
\begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceRshift}{PyObject *o1, PyObject *o2}
|
||||||
|
Returns the result of right shifting \var{o1} by \var{o2} on success, or
|
||||||
|
\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}
|
||||||
|
>>= \var{o2}}.
|
||||||
|
\end{cfuncdesc}
|
||||||
|
|
||||||
|
|
||||||
|
\begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceAnd}{PyObject *o1, PyObject *o2}
|
||||||
|
Returns the ``bitwise and'' of \var{o2} and \var{o2} on success
|
||||||
|
and \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}
|
||||||
|
\&= \var{o2}}.
|
||||||
|
\end{cfuncdesc}
|
||||||
|
|
||||||
|
|
||||||
|
\begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceXor}{PyObject *o1, PyObject *o2}
|
||||||
|
Returns the ``bitwise exclusive or'' of \var{o1} by \var{o2} on success, or
|
||||||
|
\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}
|
||||||
|
\^= \var{o2}}.
|
||||||
|
\end{cfuncdesc}
|
||||||
|
|
||||||
|
\begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceOr}{PyObject *o1, PyObject *o2}
|
||||||
|
Returns the ``bitwise or'' of \var{o1} and \var{o2} on success, or \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} |=
|
||||||
|
\var{o2}}.
|
||||||
\end{cfuncdesc}
|
\end{cfuncdesc}
|
||||||
|
|
||||||
\begin{cfuncdesc}{PyObject*}{PyNumber_Coerce}{PyObject **p1, PyObject **p2}
|
\begin{cfuncdesc}{PyObject*}{PyNumber_Coerce}{PyObject **p1, PyObject **p2}
|
||||||
|
|
@ -1703,6 +1788,20 @@ Return the result of repeating sequence object
|
||||||
equivalent of the Python expression \samp{\var{o} * \var{count}}.
|
equivalent of the Python expression \samp{\var{o} * \var{count}}.
|
||||||
\end{cfuncdesc}
|
\end{cfuncdesc}
|
||||||
|
|
||||||
|
\begin{cfuncdesc}{PyObject*}{PySequence_InPlaceConcat}{PyObject *o1, PyObject *o2}
|
||||||
|
Return the concatenation of \var{o1} and \var{o2} on success, and \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} += \var{o2}}.
|
||||||
|
\end{cfuncdesc}
|
||||||
|
|
||||||
|
|
||||||
|
\begin{cfuncdesc}{PyObject*}{PySequence_InPlaceRepeat}{PyObject *o, int count}
|
||||||
|
Return the result of repeating sequence object \var{o} \var{count} times, or
|
||||||
|
\NULL{} on failure. The operation is done \emph{in-place} when \var{o}
|
||||||
|
supports it. This is the equivalent of the Python expression \samp{\var{o}
|
||||||
|
*= \var{count}}.
|
||||||
|
\end{cfuncdesc}
|
||||||
|
|
||||||
|
|
||||||
\begin{cfuncdesc}{PyObject*}{PySequence_GetItem}{PyObject *o, int i}
|
\begin{cfuncdesc}{PyObject*}{PySequence_GetItem}{PyObject *o, int i}
|
||||||
Return the \var{i}th element of \var{o}, or \NULL{} on failure. This
|
Return the \var{i}th element of \var{o}, or \NULL{} on failure. This
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue