def __setitem__(self, name, data):
    'Create an Attribute or change its entries\n\n        @param name: name of Attribute to change\n        @type name: str\n        @param data: Entries to populate this Attribute with.\n                     Any existing Entries will be deleted!\n                     Another C{Attr} may be specified, in which\n                     case all its entries are copied.\n        @type data: scalar, list, or L{Attr}\n        '
    if isinstance(data, AttrList):
        if (name in self):
            del self[name]
        attr = self._get_or_create(name)
        for entryno in range(data.max_idx()):
            if data.has_entry(entryno):
                attr.new(data[entryno], data.type(entryno), entryno)
    else:
        attr = self._get_or_create(name)
        if isinstance(data, str_classes):
            data = [data]
        else:
            try:
                junk = len(data)
            except TypeError:
                data = [data]
        attr[:] = data
        del attr[len(data):]
Create an Attribute or change its entries

@param name: name of Attribute to change
@type name: str
@param data: Entries to populate this Attribute with.
             Any existing Entries will be deleted!
             Another C{Attr} may be specified, in which
             case all its entries are copied.
@type data: scalar, list, or L{Attr}
def __setitem__(self, name, data):
    'Create an Attribute or change its entries\n\n        @param name: name of Attribute to change\n        @type name: str\n        @param data: Entries to populate this Attribute with.\n                     Any existing Entries will be deleted!\n                     Another C{Attr} may be specified, in which\n                     case all its entries are copied.\n        @type data: scalar, list, or L{Attr}\n        '
    if isinstance(data, AttrList):
        if (name in self):
            del self[name]
        attr = self._get_or_create(name)
        for entryno in range(data.max_idx()):
            if data.has_entry(entryno):
                attr.new(data[entryno], data.type(entryno), entryno)
    else:
        attr = self._get_or_create(name)
        if isinstance(data, str_classes):
            data = [data]
        else:
            try:
                junk = len(data)
            except TypeError:
                data = [data]
        attr[:] = data
        del attr[len(data):]