class Table(object):
    """A CSV backed SQL table."""

@property
def fieldnames(self):
    with open(self.filename) as f:
        return csv.DictReader(f).fieldnames

@fieldnames.setter
def fieldnames(self, fieldnames):
    with open(self.filename, 'w') as f:
        dr = csv.reader(f)
dw = csv.DictWriter(f, fieldnames=fieldnames)
dw.writerow(dict((field, field) for field in fieldnames))
for row in self:
    dw.writerow(row)
дескриптор «геттер» требует объект «свойство», но получил «функцию»