Dear Pythonaholics: 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 <[EMAIL PROTECTED]>... On Fri, Sep 19, 2008 at 6:26 AM, Michael Foord <[EMAIL PROTECTED]>wrote: Hello all, 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. http://code.activestate.com/recipes/500261/ >>> from namedtuple import namedtuple >>> thing = namedtuple('thing', ('whizz', 'pop')) >>> thing <class '__builtin__.thing'> >>> i = thing(1, 2) >>> i.whizz 1 >>> i.pop 2 >>> w, p = i >>> w, p (1, 2) >>> i thing(whizz=1, pop=2) >>> 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. -- Vernon Cole
_______________________________________________ DB-SIG maillist - DB-SIG@python.org http://mail.python.org/mailman/listinfo/db-sig