def add_section(self, section: str, values: T.Dict[(str, T.Any)], bool_yn: bool, list_sep: T.Optional[str], subproject: str) -> None:
    for (k, v) in values.items():
        if (k in self.sections[section]):
            raise InterpreterException(f'Summary section {section!r} already have key {k!r}')
        formatted_values = []
        for i in listify(v):
            if (isinstance(i, bool) and bool_yn):
                formatted_values.append((mlog.green('YES') if i else mlog.red('NO')))
            elif isinstance(i, (str, int, bool)):
                formatted_values.append(str(i))
            elif isinstance(i, (ExternalProgram, Dependency)):
                FeatureNew.single_use('dependency or external program in summary', '0.57.0', subproject)
                formatted_values.append(i.summary_value())
            elif isinstance(i, coredata.UserOption):
                FeatureNew.single_use('feature option in summary', '0.58.0', subproject)
                formatted_values.append(i.printable_value())
            else:
                m = 'Summary value in section {!r}, key {!r}, must be string, integer, boolean, dependency or external program'
                raise InterpreterException(m.format(section, k))
        self.sections[section][k] = (formatted_values, list_sep)
        self.max_key_len = max(self.max_key_len, len(k))
def add_section(self, section: str, values: T.Dict[(str, T.Any)], bool_yn: bool, list_sep: T.Optional[str], subproject: str) -> None:
    for (k, v) in values.items():
        if (k in self.sections[section]):
            raise InterpreterException(f'Summary section {section!r} already have key {k!r}')
        formatted_values = []
        for i in listify(v):
            if (isinstance(i, bool) and bool_yn):
                formatted_values.append((mlog.green('YES') if i else mlog.red('NO')))
            elif isinstance(i, (str, int, bool)):
                formatted_values.append(str(i))
            elif isinstance(i, (ExternalProgram, Dependency)):
                FeatureNew.single_use('dependency or external program in summary', '0.57.0', subproject)
                formatted_values.append(i.summary_value())
            elif isinstance(i, coredata.UserOption):
                FeatureNew.single_use('feature option in summary', '0.58.0', subproject)
                formatted_values.append(i.printable_value())
            else:
                m = 'Summary value in section {!r}, key {!r}, must be string, integer, boolean, dependency or external program'
                raise InterpreterException(m.format(section, k))
        self.sections[section][k] = (formatted_values, list_sep)
        self.max_key_len = max(self.max_key_len, len(k))