diff --git a/util/locale_database/qlocalexml.py b/util/locale_database/qlocalexml.py index 8b2bb84cc41..4545369801a 100644 --- a/util/locale_database/qlocalexml.py +++ b/util/locale_database/qlocalexml.py @@ -571,7 +571,7 @@ class QLocaleXmlReader (object): class Spacer (object): - def __init__(self, indent = None, initial = ''): + def __init__(self, indent:str|int|None = None, initial: str = '') -> None: """Prepare to manage indentation and line breaks. Arguments are both optional. @@ -590,17 +590,17 @@ class Spacer (object): an end-tag. The text is not parsed any more carefully than just described.""" if indent is None: - self.__call = lambda x: x + self.__call: Callable[[str], str] = lambda x: x else: - self.__each = ' ' * indent if isinstance(indent, int) else indent + self.__each: str = ' ' * indent if isinstance(indent, int) else indent self.current = initial self.__call = self.__wrap - def __wrap(self, line): + def __wrap(self, line: str) -> str: if not line: return '\n' - indent = self.current + indent: str = self.current if line.startswith(' str: return self.__call(line) class QLocaleXmlWriter (object):