_PyTuple_Resize().
extern DL_IMPORT(PyObject *) PyTuple_GetItem(PyObject *, int);
extern DL_IMPORT(int) PyTuple_SetItem(PyObject *, int, PyObject *);
extern DL_IMPORT(PyObject *) PyTuple_GetSlice(PyObject *, int, int);
-extern DL_IMPORT(int) _PyTuple_Resize(PyObject **, int, int);
+extern DL_IMPORT(int) _PyTuple_Resize(PyObject **, int);
/* Macro, trading safety for speed */
#define PyTuple_GET_ITEM(op, i) (((PyTupleObject *)(op))->ob_item[i])
- Python should compile and run out of the box using the Borland C
compiler (under Windows), thanks to Stephen Hansen.
+C API
+
+- Removed the unused last_is_sticky argument from the internal
+ _PyTuple_Resize(). If this affects you, you were cheating.
+
+
What's New in Python 2.1 (final)?
=================================
context->maxsize = maxsize;
- return _PyTuple_Resize(&context->tuple, maxsize, 0) >= 0;
+ return _PyTuple_Resize(&context->tuple, maxsize) >= 0;
}
static int
if (!_flatten1(&context, item,0))
return NULL;
- if (_PyTuple_Resize(&context.tuple, context.size, 0))
+ if (_PyTuple_Resize(&context.tuple, context.size))
return NULL;
return context.tuple;
n += 10;
else
n += 100;
- if (_PyTuple_Resize(&result, n, 0) != 0) {
+ if (_PyTuple_Resize(&result, n) != 0) {
Py_DECREF(item);
goto Fail;
}
/* Cut tuple back if guess was too large. */
if (j < n &&
- _PyTuple_Resize(&result, j, 0) != 0)
+ _PyTuple_Resize(&result, j) != 0)
goto Fail;
Py_DECREF(it);
is only one module referencing the object. You can also think of it
as creating a new tuple object and destroying the old one, only more
efficiently. In any case, don't use this if the tuple may already be
- known to some other part of the code. The last_is_sticky is not used
- and must always be false. */
+ known to some other part of the code. */
int
-_PyTuple_Resize(PyObject **pv, int newsize, int last_is_sticky)
+_PyTuple_Resize(PyObject **pv, int newsize)
{
register PyTupleObject *v;
register PyTupleObject *sv;
int sizediff;
v = (PyTupleObject *) *pv;
- if (v == NULL || !PyTuple_Check(v) || last_is_sticky ||
+ if (v == NULL || !PyTuple_Check(v) ||
(v->ob_size != 0 && v->ob_refcnt != 1)) {
*pv = 0;
Py_XDECREF(v);
}
}
- if (_PyTuple_Resize(&result, j, 0) < 0)
+ if (_PyTuple_Resize(&result, j) < 0)
return NULL;
return result;