python: Elide unnecessary list wrappers.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2023-09-12 14:19:57 -07:00
committed by Tim Abbott
parent eff0a73925
commit 2665a3ce2b
49 changed files with 129 additions and 142 deletions

View File

@@ -343,7 +343,7 @@ field and send an event. For example:
def do_set_realm_authentication_methods(
realm: Realm, authentication_methods: Dict[str, bool], *, acting_user: Optional[UserProfile]
) -> None:
for key, value in list(authentication_methods.items()):
for key, value in authentication_methods.items():
index = getattr(realm.authentication_methods, key).number
realm.authentication_methods.set_bit(index, int(value))
realm.save(update_fields=['authentication_methods'])