[DB-SIG] First suggestion for db-api 3.0
vernondcole at gmail.com
Mon Sep 22 16:25:38 CEST 2008
I have not been following the development of Python 2.6 and 3.0, so the
following took me by surprise when I read it this morning. It seems to me on
first glance, that this new feature, "Named Tuple", is exactly what is
needed to make fields in database records (or columns in database rows if
you prefer) more accessible to a python programmer.
From: Discussion of IronPython <users at lists.ironpython.com>...
On Fri, Sep 19, 2008 at 6:26 AM, Michael Foord <fuzzyman at voidspace.org.uk>wrote:
At PyCon UK Raymond Hettinger showed off the Named Tuple; a very useful
recipe for creating tuples with named fields. It is becoming part of the
standard library in Python 2.6.
>>> from namedtuple import namedtuple
>>> thing = namedtuple('thing', ('whizz', 'pop'))
>>> i = thing(1, 2)
>>> w, p = i
>>> w, p
I would like to suggest that we start the process of creating a dbapi 3.0
specification, and that the new spec define the returned data as an iterator
of Named Tuples.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the DB-SIG