diff --git a/l10n.py b/l10n.py index 83600383..e2c1143f 100755 --- a/l10n.py +++ b/l10n.py @@ -83,7 +83,7 @@ class _Translations: self.translations = {None: {}} builtins.__dict__['_'] = lambda x: str(x).replace(r'\"', '"').replace('{CR}', '\n') - def install(self, lang: str = None) -> None: # noqa: CCR001 + def install(self, lang: str | None = None) -> None: # noqa: CCR001 """ Install the translation function to the _ builtin. @@ -250,7 +250,7 @@ class _Locale: self.float_formatter.setMinimumFractionDigits_(5) self.float_formatter.setMaximumFractionDigits_(5) - def stringFromNumber(self, number: Union[float, int], decimals: int = None) -> str: # noqa: N802 + def stringFromNumber(self, number: Union[float, int], decimals: int | None = None) -> str: # noqa: N802 warnings.warn(DeprecationWarning('use _Locale.string_from_number instead.')) return self.string_from_number(number, decimals) # type: ignore