diff options
author | Fred Drake <fdrake@acm.org> | 2000-09-12 20:27:05 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-09-12 20:27:05 (GMT) |
commit | 7740a0109679b3dc0b258b2121f0fbfa554bd1ea (patch) | |
tree | 0e73657f1f2fb489a7725f59436e435037cea0a0 /Doc/api | |
parent | 9c940ca1438b774b736863981e76ca81f459204f (diff) | |
download | cpython-7740a0109679b3dc0b258b2121f0fbfa554bd1ea.zip cpython-7740a0109679b3dc0b258b2121f0fbfa554bd1ea.tar.gz cpython-7740a0109679b3dc0b258b2121f0fbfa554bd1ea.tar.bz2 |
Thomas Wouters <thomas@xs4all.net>:
Fix up some of the PyNumber_*() documentation.
Add documentation for the InPlace API calls.
Diffstat (limited to 'Doc/api')
-rw-r--r-- | Doc/api/api.tex | 113 |
1 files changed, 106 insertions, 7 deletions
diff --git a/Doc/api/api.tex b/Doc/api/api.tex index f75768a..227698a 100644 --- a/Doc/api/api.tex +++ b/Doc/api/api.tex @@ -1625,22 +1625,107 @@ expression \samp{\var{o1} >> \var{o2}}. \begin{cfuncdesc}{PyObject*}{PyNumber_And}{PyObject *o1, PyObject *o2} -Returns the result of ``anding'' \var{o2} and \var{o2} on success and -\NULL{} on failure. This is the equivalent of the Python -expression \samp{\var{o1} and \var{o2}}. +Returns the ``bitwise and'' of \var{o2} and \var{o2} on success and +\NULL{} on failure. This is the equivalent of the Python expression +\samp{\var{o1} \& \var{o2}}. \end{cfuncdesc} \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 expression \samp{\var{o1} \^{ }\var{o2}}. \end{cfuncdesc} \begin{cfuncdesc}{PyObject*}{PyNumber_Or}{PyObject *o1, PyObject *o2} -Returns the result of \var{o1} and \var{o2} on success, or \NULL{} on -failure. This is the equivalent of the Python expression -\samp{\var{o1} or \var{o2}}. +Returns the ``bitwise or'' of \var{o1} and \var{o2} on success, or +\NULL{} on failure. This is the equivalent of the Python expression +\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} \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}}. \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} Return the \var{i}th element of \var{o}, or \NULL{} on failure. This |