def MutableNamedTupleRow(cursor):
 from recordtype import recordtype
 attr_names = [x[0] for x in cursor._ColBufferList]
 class Row(recordtype('Row', attr_names, rename=True), ):
  cursor_description = cursor.description
  def __init__(self, iterable):
   super(Row, self).__init__(*iterable)
  def __iter__(self):
   for field_name in self.__slots__:
    (yield getattr(self, field_name))
  def __getitem__(self, index):
   if isinstance(index, slice):
    return tuple((getattr(self, x) for x in self.__slots__[index]))
   return getattr(self, self.__slots__[index])
  def __setitem__(self, index, value):
   setattr(self, self.__slots__[index], value)
 return Row

def MutableNamedTupleRow ( cursor ) : from recordtype import recordtype attr_names = [ x [ 0 ] for x in cursor . _ColBufferList ] class Row ( recordtype ( 'Row' , attr_names , rename = True ) , ) : cursor_description = cursor . description def __init__ ( self , iterable ) : super ( Row , self ) . __init__ ( * iterable ) def __iter__ ( self ) : for field_name in self . __slots__ : ( yield getattr ( self , field_name ) ) def __getitem__ ( self , index ) : if isinstance ( index , slice ) : return tuple ( ( getattr ( self , x ) for x in self . __slots__ [ index ] ) ) return getattr ( self , self . __slots__ [ index ] ) def __setitem__ ( self , index , value ) : setattr ( self , self . __slots__ [ index ] , value ) return Row
mutable named tuple to allow attribute to be replaced .