python: Rewrite list() as [].

Suggested by the flake8-comprehensions plugin.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2020-09-01 23:17:06 -07:00 committed by Tim Abbott
parent a276eefcfe
commit 02725d32dd
3 changed files with 3 additions and 3 deletions

View File

@ -1139,7 +1139,7 @@ def get_incoming_message_ids(import_dir: Path,
''' '''
if sort_by_date: if sort_by_date:
tups: List[Tuple[int, int]] = list() tups: List[Tuple[int, int]] = []
else: else:
message_ids: List[int] = [] message_ids: List[int] = []

View File

@ -2124,7 +2124,7 @@ def privacy_clean_markdown(content: str) -> str:
def get_possible_mentions_info(realm_id: int, mention_texts: Set[str]) -> List[FullNameInfo]: def get_possible_mentions_info(realm_id: int, mention_texts: Set[str]) -> List[FullNameInfo]:
if not mention_texts: if not mention_texts:
return list() return []
# Remove the trailing part of the `name|id` mention syntax, # Remove the trailing part of the `name|id` mention syntax,
# thus storing only full names in full_names. # thus storing only full names in full_names.

View File

@ -1179,7 +1179,7 @@ def get_recent_private_conversations(user_profile: UserProfile) -> Dict[int, Dic
for recipient_id, max_message_id in rows: for recipient_id, max_message_id in rows:
recipient_map[recipient_id] = dict( recipient_map[recipient_id] = dict(
max_message_id=max_message_id, max_message_id=max_message_id,
user_ids=list(), user_ids=[],
) )
# Now we need to map all the recipient_id objects to lists of user IDs # Now we need to map all the recipient_id objects to lists of user IDs