l10n.py: Two minor typing fixes

This commit is contained in:
Athanasius committed 2022-12-23 14:47:09 +00:00
1 parent 85fc308d42
commit 36bd08d715
1 file changed
+2 -2
+2 -2
View File
@@ -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