mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-07-27 16:05:17 -04:00
Clarify list/set/dict/tuple comprehensions and enforce via flake8 (#6957)
Ensure good comprehension hygiene using flake8-comprehensions.
This commit is contained in:
parent
272eee1ae1
commit
509e381afa
73 changed files with 251 additions and 276 deletions
|
@ -58,7 +58,7 @@ class ReceiptsWorkerStore(SQLBaseStore):
|
|||
@cachedInlineCallbacks()
|
||||
def get_users_with_read_receipts_in_room(self, room_id):
|
||||
receipts = yield self.get_receipts_for_room(room_id, "m.read")
|
||||
return set(r["user_id"] for r in receipts)
|
||||
return {r["user_id"] for r in receipts}
|
||||
|
||||
@cached(num_args=2)
|
||||
def get_receipts_for_room(self, room_id, receipt_type):
|
||||
|
@ -283,7 +283,7 @@ class ReceiptsWorkerStore(SQLBaseStore):
|
|||
args.append(limit)
|
||||
txn.execute(sql, args)
|
||||
|
||||
return list(r[0:5] + (json.loads(r[5]),) for r in txn)
|
||||
return [r[0:5] + (json.loads(r[5]),) for r in txn]
|
||||
|
||||
return self.db.runInteraction(
|
||||
"get_all_updated_receipts", get_all_updated_receipts_txn
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue