Skip to content

Commit 2fe0a70

Browse files
committed
refactor(utils): more generic types of group_join
Addressing issues in #69 (review)
1 parent 8d36309 commit 2fe0a70

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def tstr(key: str, **kwargs) -> locale_str:
200200

201201
return locale_str(t(key, locale=i18n.config.get('fallback'), **kwargs), key=key, **kwargs)
202202

203-
def group_join(l: list[str], max_group_size: int, sep: str = "\n") -> list[str]:
203+
def group_join(l: Iterable[str], max_group_size: int, sep: str = "\n") -> list[str]:
204204
"""
205205
Group items from a list into strings based on a maximum group size and a separator.
206206
@@ -216,7 +216,7 @@ def group_join(l: list[str], max_group_size: int, sep: str = "\n") -> list[str]:
216216
list while adhering to the maximum group size constraint.
217217
"""
218218

219-
groups = []
219+
groups = list[str]()
220220
for item in l:
221221
if not groups:
222222
groups.append(item)

0 commit comments

Comments
 (0)