Skip to content

Commit 821ecc0

Browse files
authored
Merge pull request #6188 from MetRonnie/flake8
flake8-comprehensions
2 parents dbfdce9 + cd18952 commit 821ecc0

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

cylc/flow/network/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ async def get_nodes_edges(root, info: 'ResolveInfo', **args):
502502

503503

504504
def resolve_state_totals(root, info, **args):
505-
state_totals = {state: 0 for state in TASK_STATUSES_ORDERED}
505+
state_totals = dict.fromkeys(TASK_STATUSES_ORDERED, 0)
506506
# Update with converted protobuf map container
507507
state_totals.update(
508508
dict(getattr(root, to_snake_case(info.field_name), {})))

cylc/flow/task_outputs.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,7 @@ def get_optional_outputs(
251251
)
252252
for output in used_compvars
253253
},
254-
# the outputs that are not used in the expression
255-
**{
256-
output: None
257-
for output in all_compvars - used_compvars
258-
},
254+
**dict.fromkeys(all_compvars - used_compvars),
259255
}
260256

261257

cylc/flow/tui/updater.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,8 @@ def get_default_filters():
6868
These filters show everything.
6969
"""
7070
return {
71-
'tasks': {
72-
# filtered task statuses
73-
state: True
74-
for state in TASK_STATUSES_ORDERED
75-
},
71+
# filtered task statuses
72+
'tasks': dict.fromkeys(TASK_STATUSES_ORDERED, True),
7673
'workflows': {
7774
# filtered workflow statuses
7875
**{

0 commit comments

Comments
 (0)