summaryrefslogtreecommitdiffstats
path: root/Doc/api/abstract.tex
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-03-01 05:16:03 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2006-03-01 05:16:03 (GMT)
commit29fafd8708cb19f1c2350618426dd99b4d76819a (patch)
tree75d4eb09cce9b62f6c6f44e07877c8471c5516be /Doc/api/abstract.tex
parent67d70eb957faf61e0cba548fcad374ec361429c4 (diff)
downloadcpython-29fafd8708cb19f1c2350618426dd99b4d76819a.zip
cpython-29fafd8708cb19f1c2350618426dd99b4d76819a.tar.gz
cpython-29fafd8708cb19f1c2350618426dd99b4d76819a.tar.bz2
Make documentation match the implementation.
Diffstat (limited to 'Doc/api/abstract.tex')
-rw-r--r--Doc/api/abstract.tex48
1 files changed, 24 insertions, 24 deletions
diff --git a/Doc/api/abstract.tex b/Doc/api/abstract.tex
index 156583c..c543563 100644
--- a/Doc/api/abstract.tex
+++ b/Doc/api/abstract.tex
@@ -16,7 +16,7 @@ for which they do not apply, they will raise a Python exception.
object is written instead of the \function{repr()}.
\end{cfuncdesc}
-\begin{cfuncdesc}{int}{PyObject_HasAttrString}{PyObject *o, char *attr_name}
+\begin{cfuncdesc}{int}{PyObject_HasAttrString}{PyObject *o, const char *attr_name}
Returns \code{1} if \var{o} has the attribute \var{attr_name}, and
\code{0} otherwise. This is equivalent to the Python expression
\samp{hasattr(\var{o}, \var{attr_name})}. This function always
@@ -24,7 +24,7 @@ for which they do not apply, they will raise a Python exception.
\end{cfuncdesc}
\begin{cfuncdesc}{PyObject*}{PyObject_GetAttrString}{PyObject *o,
- char *attr_name}
+ const char *attr_name}
Retrieve an attribute named \var{attr_name} from object \var{o}.
Returns the attribute value on success, or \NULL{} on failure.
This is the equivalent of the Python expression
@@ -50,7 +50,7 @@ for which they do not apply, they will raise a Python exception.
\begin{cfuncdesc}{int}{PyObject_SetAttrString}{PyObject *o,
- char *attr_name, PyObject *v}
+ const char *attr_name, PyObject *v}
Set the value of the attribute named \var{attr_name}, for object
\var{o}, to the value \var{v}. Returns \code{-1} on failure. This
is the equivalent of the Python statement
@@ -67,7 +67,7 @@ for which they do not apply, they will raise a Python exception.
\end{cfuncdesc}
-\begin{cfuncdesc}{int}{PyObject_DelAttrString}{PyObject *o, char *attr_name}
+\begin{cfuncdesc}{int}{PyObject_DelAttrString}{PyObject *o, const char *attr_name}
Delete attribute named \var{attr_name}, for object \var{o}. Returns
\code{-1} on failure. This is the equivalent of the Python
statement: \samp{del \var{o}.\var{attr_name}}.
@@ -301,7 +301,7 @@ determination.
\end{cfuncdesc}
-\begin{cfuncdesc}{int}{PyObject_Hash}{PyObject *o}
+\begin{cfuncdesc}{long}{PyObject_Hash}{PyObject *o}
Compute and return the hash value of an object \var{o}. On failure,
return \code{-1}. This is the equivalent of the Python expression
\samp{hash(\var{o})}.\bifuncindex{hash}
@@ -340,8 +340,8 @@ determination.
\versionadded{2.2}
\end{cfuncdesc}
-\begin{cfuncdesc}{int}{PyObject_Length}{PyObject *o}
-\cfuncline{int}{PyObject_Size}{PyObject *o}
+\begin{cfuncdesc}{Py_ssize_t}{PyObject_Length}{PyObject *o}
+\cfuncline{Py_ssize_t}{PyObject_Size}{PyObject *o}
Return the length of object \var{o}. If the object \var{o} provides
either the sequence and mapping protocols, the sequence length is
returned. On error, \code{-1} is returned. This is the equivalent
@@ -697,14 +697,14 @@ determination.
\code{0} otherwise. This function always succeeds.
\end{cfuncdesc}
-\begin{cfuncdesc}{int}{PySequence_Size}{PyObject *o}
+\begin{cfuncdesc}{Py_ssize_t}{PySequence_Size}{PyObject *o}
Returns the number of objects in sequence \var{o} on success, and
\code{-1} on failure. For objects that do not provide sequence
protocol, this is equivalent to the Python expression
\samp{len(\var{o})}.\bifuncindex{len}
\end{cfuncdesc}
-\begin{cfuncdesc}{int}{PySequence_Length}{PyObject *o}
+\begin{cfuncdesc}{Py_ssize_t}{PySequence_Length}{PyObject *o}
Alternate name for \cfunction{PySequence_Size()}.
\end{cfuncdesc}
@@ -715,7 +715,7 @@ determination.
\end{cfuncdesc}
-\begin{cfuncdesc}{PyObject*}{PySequence_Repeat}{PyObject *o, int count}
+\begin{cfuncdesc}{PyObject*}{PySequence_Repeat}{PyObject *o, Py_ssize_t count}
Return the result of repeating sequence object \var{o} \var{count}
times, or \NULL{} on failure. This is the equivalent of the Python
expression \samp{\var{o} * \var{count}}.
@@ -730,7 +730,7 @@ determination.
\end{cfuncdesc}
-\begin{cfuncdesc}{PyObject*}{PySequence_InPlaceRepeat}{PyObject *o, int count}
+\begin{cfuncdesc}{PyObject*}{PySequence_InPlaceRepeat}{PyObject *o, Py_ssize_t 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
@@ -738,41 +738,41 @@ determination.
\end{cfuncdesc}
-\begin{cfuncdesc}{PyObject*}{PySequence_GetItem}{PyObject *o, int i}
+\begin{cfuncdesc}{PyObject*}{PySequence_GetItem}{PyObject *o, Py_ssize_t i}
Return the \var{i}th element of \var{o}, or \NULL{} on failure.
This is the equivalent of the Python expression
\samp{\var{o}[\var{i}]}.
\end{cfuncdesc}
-\begin{cfuncdesc}{PyObject*}{PySequence_GetSlice}{PyObject *o, int i1, int i2}
+\begin{cfuncdesc}{PyObject*}{PySequence_GetSlice}{PyObject *o, Py_ssize_t i1, Py_ssize_t i2}
Return the slice of sequence object \var{o} between \var{i1} and
\var{i2}, or \NULL{} on failure. This is the equivalent of the
Python expression \samp{\var{o}[\var{i1}:\var{i2}]}.
\end{cfuncdesc}
-\begin{cfuncdesc}{int}{PySequence_SetItem}{PyObject *o, int i, PyObject *v}
+\begin{cfuncdesc}{int}{PySequence_SetItem}{PyObject *o, Py_ssize_t i, PyObject *v}
Assign object \var{v} to the \var{i}th element of \var{o}. Returns
\code{-1} on failure. This is the equivalent of the Python
statement \samp{\var{o}[\var{i}] = \var{v}}. This function \emph{does not}
steal a reference to \var{v}.
\end{cfuncdesc}
-\begin{cfuncdesc}{int}{PySequence_DelItem}{PyObject *o, int i}
+\begin{cfuncdesc}{int}{PySequence_DelItem}{PyObject *o, Py_ssize_t i}
Delete the \var{i}th element of object \var{o}. Returns \code{-1}
on failure. This is the equivalent of the Python statement
\samp{del \var{o}[\var{i}]}.
\end{cfuncdesc}
-\begin{cfuncdesc}{int}{PySequence_SetSlice}{PyObject *o, int i1,
- int i2, PyObject *v}
+\begin{cfuncdesc}{int}{PySequence_SetSlice}{PyObject *o, Py_ssize_t i1,
+ Py_ssize_t i2, PyObject *v}
Assign the sequence object \var{v} to the slice in sequence object
\var{o} from \var{i1} to \var{i2}. This is the equivalent of the
Python statement \samp{\var{o}[\var{i1}:\var{i2}] = \var{v}}.
\end{cfuncdesc}
-\begin{cfuncdesc}{int}{PySequence_DelSlice}{PyObject *o, int i1, int i2}
+\begin{cfuncdesc}{int}{PySequence_DelSlice}{PyObject *o, Py_ssize_t i1, Py_ssize_t i2}
Delete the slice in sequence object \var{o} from \var{i1} to
\var{i2}. Returns \code{-1} on failure. This is the equivalent of
the Python statement \samp{del \var{o}[\var{i1}:\var{i2}]}.
@@ -821,7 +821,7 @@ determination.
text.
\end{cfuncdesc}
-\begin{cfuncdesc}{PyObject*}{PySequence_Fast_GET_ITEM}{PyObject *o, int i}
+\begin{cfuncdesc}{PyObject*}{PySequence_Fast_GET_ITEM}{PyObject *o, Py_ssize_t i}
Return the \var{i}th element of \var{o}, assuming that \var{o} was
returned by \cfunction{PySequence_Fast()}, \var{o} is not \NULL,
and that \var{i} is within bounds.
@@ -834,7 +834,7 @@ determination.
\versionadded{2.4}
\end{cfuncdesc}
-\begin{cfuncdesc}{PyObject*}{PySequence_ITEM}{PyObject *o, int i}
+\begin{cfuncdesc}{PyObject*}{PySequence_ITEM}{PyObject *o, Py_ssize_t i}
Return the \var{i}th element of \var{o} or \NULL{} on failure.
Macro form of \cfunction{PySequence_GetItem()} but without checking
that \cfunction{PySequence_Check(\var{o})} is true and without
@@ -860,7 +860,7 @@ determination.
\end{cfuncdesc}
-\begin{cfuncdesc}{int}{PyMapping_Length}{PyObject *o}
+\begin{cfuncdesc}{Py_ssize_t}{PyMapping_Length}{PyObject *o}
Returns the number of keys in object \var{o} on success, and
\code{-1} on failure. For objects that do not provide mapping
protocol, this is equivalent to the Python expression
@@ -986,7 +986,7 @@ else {
\begin{cfuncdesc}{int}{PyObject_AsCharBuffer}{PyObject *obj,
const char **buffer,
- int *buffer_len}
+ Py_ssize_t *buffer_len}
Returns a pointer to a read-only memory location useable as character-
based input. The \var{obj} argument must support the single-segment
character buffer interface. On success, returns \code{0}, sets
@@ -997,7 +997,7 @@ else {
\begin{cfuncdesc}{int}{PyObject_AsReadBuffer}{PyObject *obj,
const void **buffer,
- int *buffer_len}
+ Py_ssize_t *buffer_len}
Returns a pointer to a read-only memory location containing
arbitrary data. The \var{obj} argument must support the
single-segment readable buffer interface. On success, returns
@@ -1015,7 +1015,7 @@ else {
\begin{cfuncdesc}{int}{PyObject_AsWriteBuffer}{PyObject *obj,
void **buffer,
- int *buffer_len}
+ Py_ssize_t *buffer_len}
Returns a pointer to a writeable memory location. The \var{obj}
argument must support the single-segment, character buffer
interface. On success, returns \code{0}, sets \var{buffer} to the