From 36bd08d7150d5320aa3983e7175f550b72b3238e Mon Sep 17 00:00:00 2001 From: Athanasius Date: Thu, 22 Dec 2022 13:31:24 +0000 Subject: [PATCH] l10n.py: Two minor typing fixes --- l10n.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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