Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 1 | .. highlightlang:: c |
| 2 | |
| 3 | .. _sequence: |
| 4 | |
| 5 | Sequence Protocol |
| 6 | ================= |
| 7 | |
| 8 | |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 9 | .. c:function:: int PySequence_Check(PyObject *o) |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 10 | |
| 11 | Return ``1`` if the object provides sequence protocol, and ``0`` otherwise. |
| 12 | This function always succeeds. |
| 13 | |
| 14 | |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 15 | .. c:function:: Py_ssize_t PySequence_Size(PyObject *o) |
Jeroen Ruigrok van der Werven | 089c5cd | 2009-04-25 17:59:03 +0000 | [diff] [blame] | 16 | Py_ssize_t PySequence_Length(PyObject *o) |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 17 | |
| 18 | .. index:: builtin: len |
| 19 | |
Miss Islington (bot) | ecaa372 | 2018-02-25 13:22:43 -0800 | [diff] [blame] | 20 | Returns the number of objects in sequence *o* on success, and ``-1`` on |
| 21 | failure. This is equivalent to the Python expression ``len(o)``. |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 22 | |
Jeroen Ruigrok van der Werven | 089c5cd | 2009-04-25 17:59:03 +0000 | [diff] [blame] | 23 | .. versionchanged:: 2.5 |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 24 | These functions returned an :c:type:`int` type. This might require |
Jeroen Ruigrok van der Werven | 089c5cd | 2009-04-25 17:59:03 +0000 | [diff] [blame] | 25 | changes in your code for properly supporting 64-bit systems. |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 26 | |
| 27 | |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 28 | .. c:function:: PyObject* PySequence_Concat(PyObject *o1, PyObject *o2) |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 29 | |
| 30 | Return the concatenation of *o1* and *o2* on success, and *NULL* on failure. |
| 31 | This is the equivalent of the Python expression ``o1 + o2``. |
| 32 | |
| 33 | |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 34 | .. c:function:: PyObject* PySequence_Repeat(PyObject *o, Py_ssize_t count) |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 35 | |
| 36 | Return the result of repeating sequence object *o* *count* times, or *NULL* on |
| 37 | failure. This is the equivalent of the Python expression ``o * count``. |
| 38 | |
Jeroen Ruigrok van der Werven | 089c5cd | 2009-04-25 17:59:03 +0000 | [diff] [blame] | 39 | .. versionchanged:: 2.5 |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 40 | This function used an :c:type:`int` type for *count*. This might require |
Jeroen Ruigrok van der Werven | 089c5cd | 2009-04-25 17:59:03 +0000 | [diff] [blame] | 41 | changes in your code for properly supporting 64-bit systems. |
| 42 | |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 43 | |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 44 | .. c:function:: PyObject* PySequence_InPlaceConcat(PyObject *o1, PyObject *o2) |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 45 | |
| 46 | Return the concatenation of *o1* and *o2* on success, and *NULL* on failure. |
| 47 | The operation is done *in-place* when *o1* supports it. This is the equivalent |
| 48 | of the Python expression ``o1 += o2``. |
| 49 | |
| 50 | |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 51 | .. c:function:: PyObject* PySequence_InPlaceRepeat(PyObject *o, Py_ssize_t count) |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 52 | |
| 53 | Return the result of repeating sequence object *o* *count* times, or *NULL* on |
| 54 | failure. The operation is done *in-place* when *o* supports it. This is the |
| 55 | equivalent of the Python expression ``o *= count``. |
| 56 | |
Jeroen Ruigrok van der Werven | 089c5cd | 2009-04-25 17:59:03 +0000 | [diff] [blame] | 57 | .. versionchanged:: 2.5 |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 58 | This function used an :c:type:`int` type for *count*. This might require |
Jeroen Ruigrok van der Werven | 089c5cd | 2009-04-25 17:59:03 +0000 | [diff] [blame] | 59 | changes in your code for properly supporting 64-bit systems. |
| 60 | |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 61 | |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 62 | .. c:function:: PyObject* PySequence_GetItem(PyObject *o, Py_ssize_t i) |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 63 | |
Georg Brandl | 6a46898 | 2009-05-30 10:33:23 +0000 | [diff] [blame] | 64 | Return the *i*\ th element of *o*, or *NULL* on failure. This is the equivalent of |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 65 | the Python expression ``o[i]``. |
| 66 | |
Jeroen Ruigrok van der Werven | 089c5cd | 2009-04-25 17:59:03 +0000 | [diff] [blame] | 67 | .. versionchanged:: 2.5 |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 68 | This function used an :c:type:`int` type for *i*. This might require |
Jeroen Ruigrok van der Werven | 089c5cd | 2009-04-25 17:59:03 +0000 | [diff] [blame] | 69 | changes in your code for properly supporting 64-bit systems. |
| 70 | |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 71 | |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 72 | .. c:function:: PyObject* PySequence_GetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2) |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 73 | |
| 74 | Return the slice of sequence object *o* between *i1* and *i2*, or *NULL* on |
| 75 | failure. This is the equivalent of the Python expression ``o[i1:i2]``. |
| 76 | |
Jeroen Ruigrok van der Werven | 089c5cd | 2009-04-25 17:59:03 +0000 | [diff] [blame] | 77 | .. versionchanged:: 2.5 |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 78 | This function used an :c:type:`int` type for *i1* and *i2*. This might |
Jeroen Ruigrok van der Werven | 089c5cd | 2009-04-25 17:59:03 +0000 | [diff] [blame] | 79 | require changes in your code for properly supporting 64-bit systems. |
| 80 | |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 81 | |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 82 | .. c:function:: int PySequence_SetItem(PyObject *o, Py_ssize_t i, PyObject *v) |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 83 | |
Martin Panter | ed82604 | 2016-11-30 10:32:40 +0000 | [diff] [blame] | 84 | Assign object *v* to the *i*\ th element of *o*. Raise an exception |
| 85 | and return ``-1`` on failure; return ``0`` on success. This |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 86 | is the equivalent of the Python statement ``o[i] = v``. This function *does |
| 87 | not* steal a reference to *v*. |
| 88 | |
Martin Panter | ed82604 | 2016-11-30 10:32:40 +0000 | [diff] [blame] | 89 | If *v* is *NULL*, the element is deleted, however this feature is |
| 90 | deprecated in favour of using :c:func:`PySequence_DelItem`. |
| 91 | |
Jeroen Ruigrok van der Werven | 089c5cd | 2009-04-25 17:59:03 +0000 | [diff] [blame] | 92 | .. versionchanged:: 2.5 |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 93 | This function used an :c:type:`int` type for *i*. This might require |
Jeroen Ruigrok van der Werven | 089c5cd | 2009-04-25 17:59:03 +0000 | [diff] [blame] | 94 | changes in your code for properly supporting 64-bit systems. |
| 95 | |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 96 | |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 97 | .. c:function:: int PySequence_DelItem(PyObject *o, Py_ssize_t i) |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 98 | |
Georg Brandl | 6a46898 | 2009-05-30 10:33:23 +0000 | [diff] [blame] | 99 | Delete the *i*\ th element of object *o*. Returns ``-1`` on failure. This is the |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 100 | equivalent of the Python statement ``del o[i]``. |
| 101 | |
Jeroen Ruigrok van der Werven | 089c5cd | 2009-04-25 17:59:03 +0000 | [diff] [blame] | 102 | .. versionchanged:: 2.5 |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 103 | This function used an :c:type:`int` type for *i*. This might require |
Jeroen Ruigrok van der Werven | 089c5cd | 2009-04-25 17:59:03 +0000 | [diff] [blame] | 104 | changes in your code for properly supporting 64-bit systems. |
| 105 | |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 106 | |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 107 | .. c:function:: int PySequence_SetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2, PyObject *v) |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 108 | |
| 109 | Assign the sequence object *v* to the slice in sequence object *o* from *i1* to |
Martin Panter | ed82604 | 2016-11-30 10:32:40 +0000 | [diff] [blame] | 110 | *i2*. Raise an exception and return ``-1`` on failure; return ``0`` on success. |
| 111 | This is the equivalent of the Python statement ``o[i1:i2] = v``. |
| 112 | |
| 113 | If *v* is *NULL*, the slice is deleted, however this feature is |
| 114 | deprecated in favour of using :c:func:`PySequence_DelSlice`. |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 115 | |
Jeroen Ruigrok van der Werven | 089c5cd | 2009-04-25 17:59:03 +0000 | [diff] [blame] | 116 | .. versionchanged:: 2.5 |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 117 | This function used an :c:type:`int` type for *i1* and *i2*. This might |
Jeroen Ruigrok van der Werven | 089c5cd | 2009-04-25 17:59:03 +0000 | [diff] [blame] | 118 | require changes in your code for properly supporting 64-bit systems. |
| 119 | |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 120 | |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 121 | .. c:function:: int PySequence_DelSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2) |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 122 | |
| 123 | Delete the slice in sequence object *o* from *i1* to *i2*. Returns ``-1`` on |
| 124 | failure. This is the equivalent of the Python statement ``del o[i1:i2]``. |
| 125 | |
Jeroen Ruigrok van der Werven | 089c5cd | 2009-04-25 17:59:03 +0000 | [diff] [blame] | 126 | .. versionchanged:: 2.5 |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 127 | This function used an :c:type:`int` type for *i1* and *i2*. This might |
Jeroen Ruigrok van der Werven | 089c5cd | 2009-04-25 17:59:03 +0000 | [diff] [blame] | 128 | require changes in your code for properly supporting 64-bit systems. |
| 129 | |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 130 | |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 131 | .. c:function:: Py_ssize_t PySequence_Count(PyObject *o, PyObject *value) |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 132 | |
| 133 | Return the number of occurrences of *value* in *o*, that is, return the number |
| 134 | of keys for which ``o[key] == value``. On failure, return ``-1``. This is |
| 135 | equivalent to the Python expression ``o.count(value)``. |
| 136 | |
Jeroen Ruigrok van der Werven | 089c5cd | 2009-04-25 17:59:03 +0000 | [diff] [blame] | 137 | .. versionchanged:: 2.5 |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 138 | This function returned an :c:type:`int` type. This might require changes |
Jeroen Ruigrok van der Werven | 089c5cd | 2009-04-25 17:59:03 +0000 | [diff] [blame] | 139 | in your code for properly supporting 64-bit systems. |
| 140 | |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 141 | |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 142 | .. c:function:: int PySequence_Contains(PyObject *o, PyObject *value) |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 143 | |
| 144 | Determine if *o* contains *value*. If an item in *o* is equal to *value*, |
| 145 | return ``1``, otherwise return ``0``. On error, return ``-1``. This is |
| 146 | equivalent to the Python expression ``value in o``. |
| 147 | |
| 148 | |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 149 | .. c:function:: Py_ssize_t PySequence_Index(PyObject *o, PyObject *value) |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 150 | |
| 151 | Return the first index *i* for which ``o[i] == value``. On error, return |
| 152 | ``-1``. This is equivalent to the Python expression ``o.index(value)``. |
| 153 | |
Jeroen Ruigrok van der Werven | 089c5cd | 2009-04-25 17:59:03 +0000 | [diff] [blame] | 154 | .. versionchanged:: 2.5 |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 155 | This function returned an :c:type:`int` type. This might require changes |
Jeroen Ruigrok van der Werven | 089c5cd | 2009-04-25 17:59:03 +0000 | [diff] [blame] | 156 | in your code for properly supporting 64-bit systems. |
| 157 | |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 158 | |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 159 | .. c:function:: PyObject* PySequence_List(PyObject *o) |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 160 | |
| 161 | Return a list object with the same contents as the arbitrary sequence *o*. The |
| 162 | returned list is guaranteed to be new. |
| 163 | |
| 164 | |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 165 | .. c:function:: PyObject* PySequence_Tuple(PyObject *o) |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 166 | |
| 167 | .. index:: builtin: tuple |
| 168 | |
| 169 | Return a tuple object with the same contents as the arbitrary sequence *o* or |
| 170 | *NULL* on failure. If *o* is a tuple, a new reference will be returned, |
| 171 | otherwise a tuple will be constructed with the appropriate contents. This is |
| 172 | equivalent to the Python expression ``tuple(o)``. |
| 173 | |
| 174 | |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 175 | .. c:function:: PyObject* PySequence_Fast(PyObject *o, const char *m) |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 176 | |
Benjamin Peterson | 96c9a35 | 2014-04-08 10:48:36 -0400 | [diff] [blame] | 177 | Return the sequence *o* as a list, unless it is already a tuple or list, in |
| 178 | which case *o* is returned. Use :c:func:`PySequence_Fast_GET_ITEM` to access |
| 179 | the members of the result. Returns *NULL* on failure. If the object is not |
| 180 | a sequence, raises :exc:`TypeError` with *m* as the message text. |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 181 | |
| 182 | |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 183 | .. c:function:: PyObject* PySequence_Fast_GET_ITEM(PyObject *o, Py_ssize_t i) |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 184 | |
Georg Brandl | 6a46898 | 2009-05-30 10:33:23 +0000 | [diff] [blame] | 185 | Return the *i*\ th element of *o*, assuming that *o* was returned by |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 186 | :c:func:`PySequence_Fast`, *o* is not *NULL*, and that *i* is within bounds. |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 187 | |
Jeroen Ruigrok van der Werven | 3637871 | 2009-04-25 20:50:27 +0000 | [diff] [blame] | 188 | .. versionchanged:: 2.5 |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 189 | This function used an :c:type:`int` type for *i*. This might require |
Jeroen Ruigrok van der Werven | 3637871 | 2009-04-25 20:50:27 +0000 | [diff] [blame] | 190 | changes in your code for properly supporting 64-bit systems. |
| 191 | |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 192 | |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 193 | .. c:function:: PyObject** PySequence_Fast_ITEMS(PyObject *o) |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 194 | |
| 195 | Return the underlying array of PyObject pointers. Assumes that *o* was returned |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 196 | by :c:func:`PySequence_Fast` and *o* is not *NULL*. |
Georg Brandl | c62ef8b | 2009-01-03 20:55:06 +0000 | [diff] [blame] | 197 | |
Raymond Hettinger | 8dbbb96 | 2008-07-11 12:00:21 +0000 | [diff] [blame] | 198 | Note, if a list gets resized, the reallocation may relocate the items array. |
Georg Brandl | c62ef8b | 2009-01-03 20:55:06 +0000 | [diff] [blame] | 199 | So, only use the underlying array pointer in contexts where the sequence |
Raymond Hettinger | 8dbbb96 | 2008-07-11 12:00:21 +0000 | [diff] [blame] | 200 | cannot change. |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 201 | |
| 202 | .. versionadded:: 2.4 |
| 203 | |
| 204 | |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 205 | .. c:function:: PyObject* PySequence_ITEM(PyObject *o, Py_ssize_t i) |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 206 | |
Georg Brandl | 6a46898 | 2009-05-30 10:33:23 +0000 | [diff] [blame] | 207 | Return the *i*\ th element of *o* or *NULL* on failure. Macro form of |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 208 | :c:func:`PySequence_GetItem` but without checking that |
| 209 | :c:func:`PySequence_Check` on *o* is true and without adjustment for negative |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 210 | indices. |
| 211 | |
| 212 | .. versionadded:: 2.3 |
| 213 | |
Jeroen Ruigrok van der Werven | 3637871 | 2009-04-25 20:50:27 +0000 | [diff] [blame] | 214 | .. versionchanged:: 2.5 |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 215 | This function used an :c:type:`int` type for *i*. This might require |
Jeroen Ruigrok van der Werven | 3637871 | 2009-04-25 20:50:27 +0000 | [diff] [blame] | 216 | changes in your code for properly supporting 64-bit systems. |
| 217 | |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 218 | |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 219 | .. c:function:: Py_ssize_t PySequence_Fast_GET_SIZE(PyObject *o) |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 220 | |
| 221 | Returns the length of *o*, assuming that *o* was returned by |
Sandro Tosi | 98ed08f | 2012-01-14 16:42:02 +0100 | [diff] [blame] | 222 | :c:func:`PySequence_Fast` and that *o* is not *NULL*. The size can also be |
| 223 | gotten by calling :c:func:`PySequence_Size` on *o*, but |
| 224 | :c:func:`PySequence_Fast_GET_SIZE` is faster because it can assume *o* is a list |
Georg Brandl | f684272 | 2008-01-19 22:08:21 +0000 | [diff] [blame] | 225 | or tuple. |