Roundup Robot added the comment:
New changeset e47f520eb756 by Serhiy Storchaka in branch 'default':
Issue #13583: sqlite3.Row now supports slice indexing.
https://hg.python.org/cpython/rev/e47f520eb756
--
nosy: +python-dev
___
Python tracker
Changes by Serhiy Storchaka storch...@gmail.com:
--
assignee: ghaering - serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13583
___
Serhiy Storchaka added the comment:
The implementation can be much simpler, but in any case thank you for your
patches Lucas and Jessica.
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker
Serhiy Storchaka added the comment:
Could you look at the patch Gerhard?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13583
___
___
Serhiy Storchaka added the comment:
Here is a patch with much simpler implementation.
--
components: +Extension Modules
Added file: http://bugs.python.org/file38379/sqlite3_row_slice.patch
___
Python tracker rep...@bugs.python.org
Serhiy Storchaka added the comment:
May be just use PyObject_GetItem(self-data, idx)?
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13583
___
Changes by Gerhard Häring g...@ghaering.de:
--
assignee: - ghaering
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13583
___
___
Python-bugs-list
Jessica McKellar added the comment:
Thanks for the ticket and patch, xapple!
I updated the patch to address the compiler warning and use assertEqual.
While testing, I noticed that slicing with steps wasn't supported, so I
expanded the sqlite3.Row slicing code to support steps, and added some
Jessica McKellar added the comment:
I've also uploaded a short script that sets up an in-memory sqlite database
that fetches Rows, for easy manual testing.
--
Added file: http://bugs.python.org/file35071/sqlite3_slicing_demo.py
___
Python tracker
Antoine Pitrou pit...@free.fr added the comment:
Thanks for the patch. Two things:
- there is a compilation warning using gcc:
/home/antoine/cpython/default/Modules/_sqlite/row.c: In function
‘pysqlite_row_subscript’:
/home/antoine/cpython/default/Modules/_sqlite/row.c:128:26: attention :
Changes by Terry J. Reedy tjre...@udel.edu:
--
nosy: +ghaering
versions: -Python 2.6
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13583
___
___
New submission from Lucas Sinclair blastoc...@mac.com:
When using the sqlite3.Row object as a row factory, one can access the
resulting rows by index (such as row[1]) or by name (such as row['b']).
However, the slice functionality is lost, as doing row[0:2] raises the error:
slices not
12 matches
Mail list logo