On 01/24/2016 11:11 AM, Lele Gaifax wrote:
> Hi all,
> 
> I'm a bit surprised to see the following:
> 
>   >>> r = c.execute(q, idtask=reception_presence_05_01.idtask).fetchall()
>   >>> type(r[-1])
>   <class 'sqlalchemy.engine.result.RowProxy'>
>   >>> r[-1]
>   (datetime.datetime(2016, 5, 1, 18, 0), datetime.datetime(2016, 5, 1, 22, 0))
>   >>> r[-1][0]
>   datetime.datetime(2016, 5, 1, 18, 0)
>   >>> r[-1][1]
>   datetime.datetime(2016, 5, 1, 22, 0)
>   >>> r[-1][-1]
>   *** IndexError: list index out of range
> 
> I wonder whether there is an underlying reason or if it's just an oversight.

both?  the rowproxy is addressable by lots of things like strings,
Column objects.   if we want to add negative index support i can accept
PRs.   probably only for a major version like 1.1, 1.2 etc.



> 
> If the latter, should the fix go into the BaseRowProxy (C and pure Python
> version) class or into the ResultMetaData._key_fallback() method?

negative integer indexes can be worked out in terms of the positive ones
so not sure key_fallback is necessary.


> 
> Thank 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 sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to