'Correctly set a value.
Making dictionary values Section instances.
(We have to special case \'Section\' instances - which are also dicts)
Keys must be strings.
Values need only be strings (or lists of strings) if
``main.stringify`` is set.
``unrepr`` must be set when setting a value to a dictionary, without
creating a new sub-section.'

def __setitem__(self, key, value, unrepr=False):

    if (not isinstance(key, six.string_types)):
        raise ValueError(('The    key    "%s"    is    not    a    string.' % key))
    if (key not in self.comments):
        self.comments[key] = []
        self.inline_comments[key] = ''
    if (key in self.defaults):
        self.defaults.remove(key)
    if isinstance(value, Section):
        if (key not in self):
            self.sections.append(key)
        dict.__setitem__(self, key, value)
    elif (isinstance(value, collections.Mapping) and (not unrepr)):
        if (key not in self):
            self.sections.append(key)
        new_depth = (self.depth + 1)
        dict.__setitem__(self, key, Section(self, new_depth, self.main, indict=value, name=key))
    else:
        if (key not in self):
            self.scalars.append(key)
        if (not self.main.stringify):
            if isinstance(value, six.string_types):
                pass
            elif isinstance(value, (list, tuple)):
                for entry in value:
                    if (not isinstance(entry, six.string_types)):
                        raise TypeError(('Value    is    not    a    string    "%s".' % entry))
            else:
                raise TypeError(('Value    is    not    a    string    "%s".' % value))
        dict.__setitem__(self, key, value)
