On Mar 29, 2006, at 6:03 PM, Greg Ewing wrote: > On 3/29/06, Adam DePrince <[EMAIL PROTECTED]> wrote: > >>>>> rs.execute( "select upc, description, price from my_table" ) >>>>> data = rs.fetch().fieldby( 'price','upc') >>>>> print type( data ) >> >> <MultiViewMapping> > > Seems to me it would be a better idea for the DB > module to return tuple-with-attributes objects for > the rows in the first place, rather than plain > tuples. > > When I get around to reworking my custom Firebird > module, I'm going to make it do that.
It does indeed seem a great idea for a lot of tuples to sprout attributes in this way. Do we have any plans to make the "attributeing" of tuples easier for C extension writers? What about Python programmers? Looks like a simple metaclass should suffice, and we might have somewhere in the stdlib a class to inherit from in order to get the appropriate metaclass -- module 'types' seems the natural place for it. Alex _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com