'Setting tag[key] sets the value of the \'key\' attribute for the
tag.'

def __setitem__(self, key, value):

    self._getAttrMap()
    self.attrMap[key] = value
    found = False
    for i in xrange(0, len(self.attrs)):
        if (self.attrs[i][0] == key):
            self.attrs[i] = (key, value)
            found = True
    if (not found):
        self.attrs.append((key, value))
    self._getAttrMap()[key] = value
