def __getitem__(self, key):
    """Returns the value of the named column"""
    if type(key) == type(1): # if a number
      return self.row[key]
    else:  # a field name
      return self.row[self.fields[key]]
Returns the value of the named column
recipes/Python/163605_resultsetpy/recipe-163605.py