From a39d6cb420e58863976e03bb55224e3eeee2448f Mon Sep 17 00:00:00 2001 From: taizan-hokuto <55448286+taizan-hokuto@users.noreply.github.com> Date: Thu, 21 Nov 2019 22:46:15 +0900 Subject: [PATCH] Use list comprehension --- pytchat/parser/replay.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pytchat/parser/replay.py b/pytchat/parser/replay.py index bec801d..c120fe3 100644 --- a/pytchat/parser/replay.py +++ b/pytchat/parser/replay.py @@ -36,9 +36,7 @@ class Parser: raise NoContentsException('チャットデータを取得できませんでした。') interval = self.get_interval(actions) metadata.setdefault("timeoutMs",interval) - chatdata = [] - for action in actions: - chatdata.append(action["replayChatItemAction"]["actions"][0]) + chatdata = [action["replayChatItemAction"]["actions"][0] for action in actions] return metadata, chatdata def get_interval(self, actions: list):