From 974597db5b151956ea2c797eb8a5fa67cce33120 Mon Sep 17 00:00:00 2001 From: Ayo Ayco Date: Fri, 19 Apr 2024 20:11:04 +0200 Subject: [PATCH] refactor: get subset dict with wanted keys --- app.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app.py b/app.py index 5b12c5b..e42178b 100755 --- a/app.py +++ b/app.py @@ -22,10 +22,7 @@ def home(): return threads def clean_status(status): - clean = {} - clean['content'] = status['content'] - clean['created_at'] = status['created_at'] - clean['url'] = status['url'] + clean = {k: status[k] for k in {'content', 'created_at', 'url'}} if 'descendants' in status: descendants = status['descendants'] clean['descendants_count'] = len(descendants)