On 01/27/2016 12:57 PM, Lele Gaifax wrote:
> Mike Bayer <[email protected]> writes:
>
>> OK my change has revealed a bug in my test suite that wasn't catching
>> that my change fails. The C implementation uses the keymap for
>> integers. Where are you looking that it doesn't ?
>
> Uhm, in current master resultproxy.c::
right....um, OK it's actually the long, and the conditional in the C ext
being wrong for py2k.
Also my test suite had problems where my jenkins server wasn't testing
correctly, those were recent mistakes also so ive fixed those. It was
very important that I find that bug so it's a good thing this confusion
occurred.
reinstate the whole thing in 516a442f233d90eb7b8bb844e2dea7865bb21f66...
>
> static PyObject *
> BaseRowProxy_subscript(BaseRowProxy *self, PyObject *key)
> {
> ...
> #if PY_MAJOR_VERSION < 3
> if (PyInt_CheckExact(key)) {
> index = PyInt_AS_LONG(key);
> }
> #endif
>
> if (PyLong_CheckExact(key)) {
> index = PyLong_AsLong(key);
> ...
> } else if (PySlice_Check(key)) {
> values = PyObject_GetItem(self->row, key);
> ...
> return result;
> } else {
> record = PyDict_GetItem((PyObject *)self->keymap, key);
> ...
> }
> ...
> }
>
> As you can see, the keymap attribute is accessed only when the key isn't
> either an int or as a slice (under Py2 there's what seems a bug to me, that I
> cured in my diff: the first "if" should end with an "else" clause)
>
> Let me know how you prefer me going forward: I can easily try out your (now
> reverted) change, but it's up to you.
>
> ciao, lele.
>
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.