Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2ab020a

Browse files
committed
refactor: replace side-effect list comprehensions with for loops
1 parent eeb6105 commit 2ab020a

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

brickset/instructions.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,11 @@ def get_instructions(id, directory, set_number=None):
138138

139139
fetched = instructions_json['instructions']
140140
if directory:
141-
[download_instruction(directory, cur_set_number, i) for i in fetched]
141+
for i in fetched:
142+
download_instruction(directory, cur_set_number, i)
142143
else:
143-
[_print_instruction(cur_set_number, i) for i in fetched]
144+
for i in fetched:
145+
_print_instruction(cur_set_number, i)
144146

145147

146148
def _print_instruction(set_number, instruction):

brickset/sets.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ def get_sets(filters: SetFilters, limit, order_by, extended, id_only, count):
108108
if count:
109109
print(sets_json['matches'])
110110
else:
111-
[_print_set(lego_set, id_only) for lego_set in sets_json['sets']]
111+
for lego_set in sets_json['sets']:
112+
_print_set(lego_set, id_only)
112113

113114

114115
def update_set(id, owned, wanted, notes, rating):

0 commit comments

Comments
 (0)