diff options
author | Georg Brandl <georg@python.org> | 2010-10-06 10:11:56 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-10-06 10:11:56 (GMT) |
commit | 60203b41b03d03361754d264543d5fbe6259eb25 (patch) | |
tree | 005d0d6be6437244ae360ebc0d65fa7b149a8093 /Doc/c-api/tuple.rst | |
parent | 64a41edb039afee683d69bd6f72e3709ff11bd93 (diff) | |
download | cpython-60203b41b03d03361754d264543d5fbe6259eb25.zip cpython-60203b41b03d03361754d264543d5fbe6259eb25.tar.gz cpython-60203b41b03d03361754d264543d5fbe6259eb25.tar.bz2 |
Migrate to Sphinx 1.0 C language constructs.
Diffstat (limited to 'Doc/c-api/tuple.rst')
-rw-r--r-- | Doc/c-api/tuple.rst | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/Doc/c-api/tuple.rst b/Doc/c-api/tuple.rst index c1f8e12..7f6a79c 100644 --- a/Doc/c-api/tuple.rst +++ b/Doc/c-api/tuple.rst @@ -8,72 +8,72 @@ Tuple Objects .. index:: object: tuple -.. ctype:: PyTupleObject +.. c:type:: PyTupleObject - This subtype of :ctype:`PyObject` represents a Python tuple object. + This subtype of :c:type:`PyObject` represents a Python tuple object. -.. cvar:: PyTypeObject PyTuple_Type +.. c:var:: PyTypeObject PyTuple_Type .. index:: single: TupleType (in module types) - This instance of :ctype:`PyTypeObject` represents the Python tuple type; it is + This instance of :c:type:`PyTypeObject` represents the Python tuple type; it is the same object as ``tuple`` and ``types.TupleType`` in the Python layer.. -.. cfunction:: int PyTuple_Check(PyObject *p) +.. c:function:: int PyTuple_Check(PyObject *p) Return true if *p* is a tuple object or an instance of a subtype of the tuple type. -.. cfunction:: int PyTuple_CheckExact(PyObject *p) +.. c:function:: int PyTuple_CheckExact(PyObject *p) Return true if *p* is a tuple object, but not an instance of a subtype of the tuple type. -.. cfunction:: PyObject* PyTuple_New(Py_ssize_t len) +.. c:function:: PyObject* PyTuple_New(Py_ssize_t len) Return a new tuple object of size *len*, or *NULL* on failure. -.. cfunction:: PyObject* PyTuple_Pack(Py_ssize_t n, ...) +.. c:function:: PyObject* PyTuple_Pack(Py_ssize_t n, ...) Return a new tuple object of size *n*, or *NULL* on failure. The tuple values are initialized to the subsequent *n* C arguments pointing to Python objects. ``PyTuple_Pack(2, a, b)`` is equivalent to ``Py_BuildValue("(OO)", a, b)``. -.. cfunction:: Py_ssize_t PyTuple_Size(PyObject *p) +.. c:function:: Py_ssize_t PyTuple_Size(PyObject *p) Take a pointer to a tuple object, and return the size of that tuple. -.. cfunction:: Py_ssize_t PyTuple_GET_SIZE(PyObject *p) +.. c:function:: Py_ssize_t PyTuple_GET_SIZE(PyObject *p) Return the size of the tuple *p*, which must be non-*NULL* and point to a tuple; no error checking is performed. -.. cfunction:: PyObject* PyTuple_GetItem(PyObject *p, Py_ssize_t pos) +.. c:function:: PyObject* PyTuple_GetItem(PyObject *p, Py_ssize_t pos) Return the object at position *pos* in the tuple pointed to by *p*. If *pos* is out of bounds, return *NULL* and sets an :exc:`IndexError` exception. -.. cfunction:: PyObject* PyTuple_GET_ITEM(PyObject *p, Py_ssize_t pos) +.. c:function:: PyObject* PyTuple_GET_ITEM(PyObject *p, Py_ssize_t pos) - Like :cfunc:`PyTuple_GetItem`, but does no checking of its arguments. + Like :c:func:`PyTuple_GetItem`, but does no checking of its arguments. -.. cfunction:: PyObject* PyTuple_GetSlice(PyObject *p, Py_ssize_t low, Py_ssize_t high) +.. c:function:: PyObject* PyTuple_GetSlice(PyObject *p, Py_ssize_t low, Py_ssize_t high) Take a slice of the tuple pointed to by *p* from *low* to *high* and return it as a new tuple. -.. cfunction:: int PyTuple_SetItem(PyObject *p, Py_ssize_t pos, PyObject *o) +.. c:function:: int PyTuple_SetItem(PyObject *p, Py_ssize_t pos, PyObject *o) Insert a reference to object *o* at position *pos* of the tuple pointed to by *p*. Return ``0`` on success. @@ -83,9 +83,9 @@ Tuple Objects This function "steals" a reference to *o*. -.. cfunction:: void PyTuple_SET_ITEM(PyObject *p, Py_ssize_t pos, PyObject *o) +.. c:function:: void PyTuple_SET_ITEM(PyObject *p, Py_ssize_t pos, PyObject *o) - Like :cfunc:`PyTuple_SetItem`, but does no error checking, and should *only* be + Like :c:func:`PyTuple_SetItem`, but does no error checking, and should *only* be used to fill in brand new tuples. .. note:: @@ -93,7 +93,7 @@ Tuple Objects This function "steals" a reference to *o*. -.. cfunction:: int _PyTuple_Resize(PyObject **p, Py_ssize_t newsize) +.. c:function:: int _PyTuple_Resize(PyObject **p, Py_ssize_t newsize) Can be used to resize a tuple. *newsize* will be the new length of the tuple. Because tuples are *supposed* to be immutable, this should only be used if there @@ -107,6 +107,6 @@ Tuple Objects raises :exc:`MemoryError` or :exc:`SystemError`. -.. cfunction:: int PyTuple_ClearFreeList() +.. c:function:: int PyTuple_ClearFreeList() Clear the free list. Return the total number of freed items. |