mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
python: Rewrite dict() as {}.
Suggested by the flake8-comprehensions plugin. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
a610bd19a1
commit
a276eefcfe
@@ -33,7 +33,7 @@ def get_status_dicts_for_rows(all_rows: List[Dict[str, Any]],
|
||||
get_user_key = lambda row: row['user_profile__email']
|
||||
get_user_info = get_legacy_user_info
|
||||
|
||||
user_statuses: Dict[str, Dict[str, Any]] = dict()
|
||||
user_statuses: Dict[str, Dict[str, Any]] = {}
|
||||
|
||||
for user_key, presence_rows in itertools.groupby(all_rows, get_user_key):
|
||||
info = get_user_info(
|
||||
@@ -64,7 +64,7 @@ def get_modern_user_info(presence_rows: List[Dict[str, Any]],
|
||||
# Be stingy about bandwidth, and don't even include
|
||||
# keys for entities that have None values. JS
|
||||
# code should just do a falsy check here.
|
||||
result = dict()
|
||||
result = {}
|
||||
|
||||
if active_timestamp is not None:
|
||||
result['active_timestamp'] = active_timestamp
|
||||
@@ -100,7 +100,7 @@ def get_legacy_user_info(presence_rows: List[Dict[str, Any]],
|
||||
|
||||
most_recent_info = info_rows[-1]
|
||||
|
||||
result = dict()
|
||||
result = {}
|
||||
|
||||
# The word "aggegrated" here is possibly misleading.
|
||||
# It's really just the most recent client's info.
|
||||
|
||||
Reference in New Issue
Block a user