mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Added documentation for PyObject_DelItem and PySequence_Del{Item,Slice}.
This commit is contained in:
parent
360a934609
commit
d0f11dec30
1 changed files with 16 additions and 0 deletions
|
@ -202,6 +202,12 @@ From the viewpoint of of C access to Python services, we have:
|
||||||
of the Python statement: \code{o[key]=v}.
|
of the Python statement: \code{o[key]=v}.
|
||||||
|
|
||||||
|
|
||||||
|
\code{int PyObject_DelItem(PyObject *o, PyObject *key, PyObject *v)}\\
|
||||||
|
Delete the mapping for \code{key} from \code{*o}. Returns -1
|
||||||
|
on failure.
|
||||||
|
This is the equivalent of the Python statement: del o[key].
|
||||||
|
|
||||||
|
|
||||||
\subsubsection{Number Protocol}
|
\subsubsection{Number Protocol}
|
||||||
|
|
||||||
\code{int PyNumber_Check(PyObject *o)}\\
|
\code{int PyNumber_Check(PyObject *o)}\\
|
||||||
|
@ -361,11 +367,21 @@ From the viewpoint of of C access to Python services, we have:
|
||||||
Returns -1 on failure. This is the equivalent of the Python
|
Returns -1 on failure. This is the equivalent of the Python
|
||||||
statement, \code{o[i]=v}.
|
statement, \code{o[i]=v}.
|
||||||
|
|
||||||
|
\code{int PySequence_DelItem(PyObject *o, int i)}\\
|
||||||
|
Delete the \code{i}th element of object \code{v}. Returns
|
||||||
|
-1 on failure. This is the equivalent of the Python
|
||||||
|
statement: \code{del o[i]}.
|
||||||
|
|
||||||
\code{int PySequence_SetSlice(PyObject *o, int i1, int i2, PyObject *v)}\\
|
\code{int PySequence_SetSlice(PyObject *o, int i1, int i2, PyObject *v)}\\
|
||||||
Assign the sequence object \code{v} to the slice in sequence
|
Assign the sequence object \code{v} to the slice in sequence
|
||||||
object \code{o} from \code{i1} to \code{i2}. This is the equivalent of the Python
|
object \code{o} from \code{i1} to \code{i2}. This is the equivalent of the Python
|
||||||
statement, \code{o[i1:i2]=v}.
|
statement, \code{o[i1:i2]=v}.
|
||||||
|
|
||||||
|
\code{int PySequence_DelSlice(PyObject *o, int i1, int i2)}\\
|
||||||
|
Delete the slice in sequence object, \code{o}, from \code{i1} to \code{i2}.
|
||||||
|
Returns -1 on failure. This is the equivalent of the Python
|
||||||
|
statement: \code{del o[i1:i2]}.
|
||||||
|
|
||||||
\code{PyObject *PySequence_Tuple(PyObject *o)}\\
|
\code{PyObject *PySequence_Tuple(PyObject *o)}\\
|
||||||
Returns the \code{o} as a tuple on success, and NULL on failure.
|
Returns the \code{o} as a tuple on success, and NULL on failure.
|
||||||
This is equivalent to the Python expression: \code{tuple(o)}.
|
This is equivalent to the Python expression: \code{tuple(o)}.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue