'Used to implement Header.__setitem__ and CardAccessor.__setitem__.'

def _set_slice(self, key, value, target):

    if (isinstance(key, slice) or self._haswildcard(key)):
        if isinstance(key, slice):
            indices = range(*key.indices(len(target)))
        else:
            indices = self._wildcardmatch(key)
        if (isinstance(value, string_types) or (not isiterable(value))):
            value = itertools.repeat(value, len(indices))
        for (idx, val) in zip(indices, value):
            target[idx] = val
        return True
    return False
