ruff: Fix RUF025 Unnecessary dict comprehension for iterable.

This is a preview rule, not yet enabled by default.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2024-02-29 18:05:22 -08:00 committed by Tim Abbott
parent 3b114c516c
commit 869d9d9a79
2 changed files with 2 additions and 2 deletions

View File

@ -3370,7 +3370,7 @@ class GetOldMessagesTest(ZulipTestCase):
post_params = { post_params = {
**other_params, **other_params,
param: type, param: type,
**{other_param: 0 for other_param in int_params[:idx] + int_params[idx + 1 :]}, **dict.fromkeys(int_params[:idx] + int_params[idx + 1 :], 0),
} }
result = self.client_get("/json/messages", post_params) result = self.client_get("/json/messages", post_params)
self.assert_json_error(result, f"Bad value for '{param}': {type}") self.assert_json_error(result, f"Bad value for '{param}': {type}")

View File

@ -165,7 +165,7 @@ def auth_enabled_helper(
else: else:
enabled_method_dict = realm.authentication_methods_dict() enabled_method_dict = realm.authentication_methods_dict()
else: else:
enabled_method_dict = {method: True for method in AUTH_BACKEND_NAME_MAP} enabled_method_dict = dict.fromkeys(AUTH_BACKEND_NAME_MAP, True)
pad_method_dict(enabled_method_dict) pad_method_dict(enabled_method_dict)
for supported_backend in supported_auth_backends(): for supported_backend in supported_auth_backends():