Changeset 391 for python/trunk/Doc/c-api/sequence.rst
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Doc/c-api/sequence.rst
r2 r391 7 7 8 8 9 .. c function:: int PySequence_Check(PyObject *o)9 .. c:function:: int PySequence_Check(PyObject *o) 10 10 11 11 Return ``1`` if the object provides sequence protocol, and ``0`` otherwise. … … 13 13 14 14 15 .. c function:: Py_ssize_t PySequence_Size(PyObject *o)15 .. c:function:: Py_ssize_t PySequence_Size(PyObject *o) 16 16 Py_ssize_t PySequence_Length(PyObject *o) 17 17 … … 23 23 24 24 .. versionchanged:: 2.5 25 These functions returned an :c type:`int` type. This might require26 changes in your code for properly supporting 64-bit systems. 27 28 29 .. c function:: PyObject* PySequence_Concat(PyObject *o1, PyObject *o2)25 These functions returned an :c:type:`int` type. This might require 26 changes in your code for properly supporting 64-bit systems. 27 28 29 .. c:function:: PyObject* PySequence_Concat(PyObject *o1, PyObject *o2) 30 30 31 31 Return the concatenation of *o1* and *o2* on success, and *NULL* on failure. … … 33 33 34 34 35 .. c function:: PyObject* PySequence_Repeat(PyObject *o, Py_ssize_t count)35 .. c:function:: PyObject* PySequence_Repeat(PyObject *o, Py_ssize_t count) 36 36 37 37 Return the result of repeating sequence object *o* *count* times, or *NULL* on … … 39 39 40 40 .. versionchanged:: 2.5 41 This function used an :c type:`int` type for *count*. This might require42 changes in your code for properly supporting 64-bit systems. 43 44 45 .. c function:: PyObject* PySequence_InPlaceConcat(PyObject *o1, PyObject *o2)41 This function used an :c:type:`int` type for *count*. This might require 42 changes in your code for properly supporting 64-bit systems. 43 44 45 .. c:function:: PyObject* PySequence_InPlaceConcat(PyObject *o1, PyObject *o2) 46 46 47 47 Return the concatenation of *o1* and *o2* on success, and *NULL* on failure. … … 50 50 51 51 52 .. c function:: PyObject* PySequence_InPlaceRepeat(PyObject *o, Py_ssize_t count)52 .. c:function:: PyObject* PySequence_InPlaceRepeat(PyObject *o, Py_ssize_t count) 53 53 54 54 Return the result of repeating sequence object *o* *count* times, or *NULL* on … … 57 57 58 58 .. versionchanged:: 2.5 59 This function used an :c type:`int` type for *count*. This might require60 changes in your code for properly supporting 64-bit systems. 61 62 63 .. c function:: PyObject* PySequence_GetItem(PyObject *o, Py_ssize_t i)59 This function used an :c:type:`int` type for *count*. This might require 60 changes in your code for properly supporting 64-bit systems. 61 62 63 .. c:function:: PyObject* PySequence_GetItem(PyObject *o, Py_ssize_t i) 64 64 65 65 Return the *i*\ th element of *o*, or *NULL* on failure. This is the equivalent of … … 67 67 68 68 .. versionchanged:: 2.5 69 This function used an :c type:`int` type for *i*. This might require70 changes in your code for properly supporting 64-bit systems. 71 72 73 .. c function:: PyObject* PySequence_GetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2)69 This function used an :c:type:`int` type for *i*. This might require 70 changes in your code for properly supporting 64-bit systems. 71 72 73 .. c:function:: PyObject* PySequence_GetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2) 74 74 75 75 Return the slice of sequence object *o* between *i1* and *i2*, or *NULL* on … … 77 77 78 78 .. versionchanged:: 2.5 79 This function used an :c type:`int` type for *i1* and *i2*. This might79 This function used an :c:type:`int` type for *i1* and *i2*. This might 80 80 require changes in your code for properly supporting 64-bit systems. 81 81 82 82 83 .. c function:: int PySequence_SetItem(PyObject *o, Py_ssize_t i, PyObject *v)83 .. c:function:: int PySequence_SetItem(PyObject *o, Py_ssize_t i, PyObject *v) 84 84 85 85 Assign object *v* to the *i*\ th element of *o*. Returns ``-1`` on failure. This … … 88 88 89 89 .. versionchanged:: 2.5 90 This function used an :c type:`int` type for *i*. This might require91 changes in your code for properly supporting 64-bit systems. 92 93 94 .. c function:: int PySequence_DelItem(PyObject *o, Py_ssize_t i)90 This function used an :c:type:`int` type for *i*. This might require 91 changes in your code for properly supporting 64-bit systems. 92 93 94 .. c:function:: int PySequence_DelItem(PyObject *o, Py_ssize_t i) 95 95 96 96 Delete the *i*\ th element of object *o*. Returns ``-1`` on failure. This is the … … 98 98 99 99 .. versionchanged:: 2.5 100 This function used an :c type:`int` type for *i*. This might require101 changes in your code for properly supporting 64-bit systems. 102 103 104 .. c function:: int PySequence_SetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2, PyObject *v)100 This function used an :c:type:`int` type for *i*. This might require 101 changes in your code for properly supporting 64-bit systems. 102 103 104 .. c:function:: int PySequence_SetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2, PyObject *v) 105 105 106 106 Assign the sequence object *v* to the slice in sequence object *o* from *i1* to … … 108 108 109 109 .. versionchanged:: 2.5 110 This function used an :c type:`int` type for *i1* and *i2*. This might110 This function used an :c:type:`int` type for *i1* and *i2*. This might 111 111 require changes in your code for properly supporting 64-bit systems. 112 112 113 113 114 .. c function:: int PySequence_DelSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2)114 .. c:function:: int PySequence_DelSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2) 115 115 116 116 Delete the slice in sequence object *o* from *i1* to *i2*. Returns ``-1`` on … … 118 118 119 119 .. versionchanged:: 2.5 120 This function used an :c type:`int` type for *i1* and *i2*. This might120 This function used an :c:type:`int` type for *i1* and *i2*. This might 121 121 require changes in your code for properly supporting 64-bit systems. 122 122 123 123 124 .. c function:: Py_ssize_t PySequence_Count(PyObject *o, PyObject *value)124 .. c:function:: Py_ssize_t PySequence_Count(PyObject *o, PyObject *value) 125 125 126 126 Return the number of occurrences of *value* in *o*, that is, return the number … … 129 129 130 130 .. versionchanged:: 2.5 131 This function returned an :c type:`int` type. This might require changes131 This function returned an :c:type:`int` type. This might require changes 132 132 in your code for properly supporting 64-bit systems. 133 133 134 134 135 .. c function:: int PySequence_Contains(PyObject *o, PyObject *value)135 .. c:function:: int PySequence_Contains(PyObject *o, PyObject *value) 136 136 137 137 Determine if *o* contains *value*. If an item in *o* is equal to *value*, … … 140 140 141 141 142 .. c function:: Py_ssize_t PySequence_Index(PyObject *o, PyObject *value)142 .. c:function:: Py_ssize_t PySequence_Index(PyObject *o, PyObject *value) 143 143 144 144 Return the first index *i* for which ``o[i] == value``. On error, return … … 146 146 147 147 .. versionchanged:: 2.5 148 This function returned an :c type:`int` type. This might require changes148 This function returned an :c:type:`int` type. This might require changes 149 149 in your code for properly supporting 64-bit systems. 150 150 151 151 152 .. c function:: PyObject* PySequence_List(PyObject *o)152 .. c:function:: PyObject* PySequence_List(PyObject *o) 153 153 154 154 Return a list object with the same contents as the arbitrary sequence *o*. The … … 156 156 157 157 158 .. c function:: PyObject* PySequence_Tuple(PyObject *o)158 .. c:function:: PyObject* PySequence_Tuple(PyObject *o) 159 159 160 160 .. index:: builtin: tuple … … 166 166 167 167 168 .. c function:: PyObject* PySequence_Fast(PyObject *o, const char *m)168 .. c:function:: PyObject* PySequence_Fast(PyObject *o, const char *m) 169 169 170 170 Returns the sequence *o* as a tuple, unless it is already a tuple or list, in 171 which case *o* is returned. Use :c func:`PySequence_Fast_GET_ITEM` to access the171 which case *o* is returned. Use :c:func:`PySequence_Fast_GET_ITEM` to access the 172 172 members of the result. Returns *NULL* on failure. If the object is not a 173 173 sequence, raises :exc:`TypeError` with *m* as the message text. 174 174 175 175 176 .. c function:: PyObject* PySequence_Fast_GET_ITEM(PyObject *o, Py_ssize_t i)176 .. c:function:: PyObject* PySequence_Fast_GET_ITEM(PyObject *o, Py_ssize_t i) 177 177 178 178 Return the *i*\ th element of *o*, assuming that *o* was returned by 179 :c func:`PySequence_Fast`, *o* is not *NULL*, and that *i* is within bounds.180 181 .. versionchanged:: 2.5 182 This function used an :c type:`int` type for *i*. This might require183 changes in your code for properly supporting 64-bit systems. 184 185 186 .. c function:: PyObject** PySequence_Fast_ITEMS(PyObject *o)179 :c:func:`PySequence_Fast`, *o* is not *NULL*, and that *i* is within bounds. 180 181 .. versionchanged:: 2.5 182 This function used an :c:type:`int` type for *i*. This might require 183 changes in your code for properly supporting 64-bit systems. 184 185 186 .. c:function:: PyObject** PySequence_Fast_ITEMS(PyObject *o) 187 187 188 188 Return the underlying array of PyObject pointers. Assumes that *o* was returned 189 by :c func:`PySequence_Fast` and *o* is not *NULL*.189 by :c:func:`PySequence_Fast` and *o* is not *NULL*. 190 190 191 191 Note, if a list gets resized, the reallocation may relocate the items array. … … 196 196 197 197 198 .. c function:: PyObject* PySequence_ITEM(PyObject *o, Py_ssize_t i)198 .. c:function:: PyObject* PySequence_ITEM(PyObject *o, Py_ssize_t i) 199 199 200 200 Return the *i*\ th element of *o* or *NULL* on failure. Macro form of 201 :c func:`PySequence_GetItem` but without checking that202 :c func:`PySequence_Check(o)`is true and without adjustment for negative201 :c:func:`PySequence_GetItem` but without checking that 202 :c:func:`PySequence_Check` on *o* is true and without adjustment for negative 203 203 indices. 204 204 … … 206 206 207 207 .. versionchanged:: 2.5 208 This function used an :c type:`int` type for *i*. This might require209 changes in your code for properly supporting 64-bit systems. 210 211 212 .. c function:: Py_ssize_t PySequence_Fast_GET_SIZE(PyObject *o)208 This function used an :c:type:`int` type for *i*. This might require 209 changes in your code for properly supporting 64-bit systems. 210 211 212 .. c:function:: Py_ssize_t PySequence_Fast_GET_SIZE(PyObject *o) 213 213 214 214 Returns the length of *o*, assuming that *o* was returned by 215 :c func:`PySequence_Fast` and that *o* is not *NULL*. The size can also be216 gotten by calling :c func:`PySequence_Size` on *o*, but217 :c func:`PySequence_Fast_GET_SIZE` is faster because it can assume *o* is a list215 :c:func:`PySequence_Fast` and that *o* is not *NULL*. The size can also be 216 gotten by calling :c:func:`PySequence_Size` on *o*, but 217 :c:func:`PySequence_Fast_GET_SIZE` is faster because it can assume *o* is a list 218 218 or tuple.
Note:
See TracChangeset
for help on using the changeset viewer.