fix: recently added

This commit is contained in:
cwilvx
2024-06-30 21:40:49 +03:00
parent b9ad07441a
commit 5759521de0
4 changed files with 113 additions and 58 deletions
+9
View File
@@ -1,4 +1,7 @@
import locale
from typing import TypeVar
T = TypeVar("T")
# Set to user's default locale:
locale.setlocale(locale.LC_ALL, "")
@@ -9,3 +12,9 @@ locale.setlocale(locale.LC_ALL, "")
def format_number(number: float) -> str:
return locale.format_string("%d", number, grouping=True)
def flatten(list_: list[list[T]]) -> list[T]:
return [item for sublist in list_ for item in sublist]