as the sorting functions now require hashable objects
only. [ticket:1756]
+- engines
+ - The C extension now also works with DBAPIs which use custom
+ sequences as row (and not only tuples). [ticket:1757]
+
- sql
- Restored some bind-labeling logic from 0.5 which ensures
that tables with column names that overlap another column
PyObject **valueptr, **funcptr, **resultptr;
PyObject *func, *result, *processed_value, *values_fastseq;
- num_values = Py_SIZE(values);
- num_processors = Py_SIZE(processors);
+ num_values = PySequence_Length(values);
+ num_processors = PyList_Size(processors);
if (num_values != num_processors) {
PyErr_Format(PyExc_RuntimeError,
"number of values in row (%d) differ from number of column "
static Py_ssize_t
BaseRowProxy_length(BaseRowProxy *self)
{
- return Py_SIZE(self->row);
+ return PySequence_Length(self->row);
}
static PyObject *
{
PyObject *processors, *values;
PyObject *processor, *value;
- PyObject *record, *result, *indexobject;
+ PyObject *row, *record, *result, *indexobject;
PyObject *exc_module, *exception;
char *cstr_key;
long index;
if (processor == NULL)
return NULL;
- value = PyTuple_GetItem(self->row, index);
+ row = self->row;
+ if (PyTuple_CheckExact(row))
+ value = PyTuple_GetItem(row, index);
+ else
+ value = PySequence_GetItem(row, index);
if (value == NULL)
return NULL;