Skip to content

Commit f0dd375

Browse files
Unnecessary comprehension (#1997)
Use `list(...)` instead.
1 parent d6201ac commit f0dd375

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/zarr/abc/codec.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,7 @@ async def decode_partial(
187187
Iterable[NDBuffer | None]
188188
"""
189189
return await concurrent_map(
190-
[
191-
(byte_getter, selection, chunk_spec)
192-
for byte_getter, selection, chunk_spec in batch_info
193-
],
190+
list(batch_info),
194191
self._decode_partial_single,
195192
config.get("async.concurrency"),
196193
)
@@ -227,10 +224,7 @@ async def encode_partial(
227224
The chunk spec contains information about the chunk.
228225
"""
229226
await concurrent_map(
230-
[
231-
(byte_setter, chunk_array, selection, chunk_spec)
232-
for byte_setter, chunk_array, selection, chunk_spec in batch_info
233-
],
227+
list(batch_info),
234228
self._encode_partial_single,
235229
config.get("async.concurrency"),
236230
)
@@ -402,7 +396,7 @@ async def batching_helper(
402396
batch_info: Iterable[tuple[CodecInput | None, ArraySpec]],
403397
) -> list[CodecOutput | None]:
404398
return await concurrent_map(
405-
[(chunk_array, chunk_spec) for chunk_array, chunk_spec in batch_info],
399+
list(batch_info),
406400
noop_for_none(func),
407401
config.get("async.concurrency"),
408402
)

0 commit comments

Comments
 (0)