Adds the given key/value to all elements.
        Single values for a key are stored directly, as key:value, multiple
        values for the same key are stored as key,set(values).

def kadd(self, key, value):
        """Adds the given key/value to all elements.
        Single values for a key are stored directly, as key:value, multiple
        values for the same key are stored as key,set(values).
        """
        for item in self:
            try:
                # Use the key as a set
                item[key].add(value)
            except KeyError:
                # This happens if the key is not present
                item[key] = value
            except AttributeError:
                # This happens if the key is present but is not a set
                item[key] = set([item[key], value])