From dd7b09d71a10286aaffc6fb015ada246292f9c19 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sun, 24 Sep 2023 22:54:17 -0700 Subject: [PATCH] ruff: Fix C416 Unnecessary `list` comprehension. Signed-off-by: Anders Kaseorg --- zerver/forms.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/zerver/forms.py b/zerver/forms.py index 4c32272f4e..565867e05e 100644 --- a/zerver/forms.py +++ b/zerver/forms.py @@ -164,10 +164,7 @@ class RegistrationForm(RealmDetailsForm): required=False, coerce=int, empty_value=None, - choices=[ - (value, name) - for value, name in UserProfile.EMAIL_ADDRESS_VISIBILITY_ID_TO_NAME_MAP.items() - ], + choices=list(UserProfile.EMAIL_ADDRESS_VISIBILITY_ID_TO_NAME_MAP.items()), ) def __init__(self, *args: Any, **kwargs: Any) -> None: @@ -209,10 +206,7 @@ class ToSForm(forms.Form): required=False, coerce=int, empty_value=None, - choices=[ - (value, name) - for value, name in UserProfile.EMAIL_ADDRESS_VISIBILITY_ID_TO_NAME_MAP.items() - ], + choices=list(UserProfile.EMAIL_ADDRESS_VISIBILITY_ID_TO_NAME_MAP.items()), ) def __init__(self, *args: Any, **kwargs: Any) -> None: