ruff: Fix PERF401 Use a list comprehension to create a transformed list.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2023-07-31 13:52:35 -07:00
committed by Tim Abbott
parent 0b95d83f09
commit 562a79ab76
48 changed files with 495 additions and 674 deletions

View File

@@ -82,9 +82,7 @@ def get_assignee_string(assignees: List[Dict[str, Any]]) -> str:
if len(assignees) == 1:
assignees_string = "{username}".format(**assignees[0])
else:
usernames = []
for a in assignees:
usernames.append(a["username"])
usernames = [a["username"] for a in assignees]
assignees_string = ", ".join(usernames[:-1]) + " and " + usernames[-1]
return assignees_string