Skip to content

Commit b72aa5c

Browse files
authored
Merge pull request #70
Make group_join generic
2 parents 8d36309 + 3c52659 commit b72aa5c

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,10 @@ async def embed(self) -> discore.Embed:
450450
)
451451

452452
str_options_fields = group_join(
453-
[
453+
(
454454
(' - ' if indented else '- ') + t(f'settings.{id}.state.{l(state)}',
455455
**{'element': display_value, 'details': ''})
456-
for id, display_value, state, indented in options],
456+
for id, display_value, state, indented in options),
457457
1024
458458
)
459459

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)