Skip to content

Commit 3b1c83e

Browse files
MAINT: Apply ruff/flake8-comprehensions rule C410
C410 Unnecessary `list` literal passed to `list()` (remove the outer call to `list()`)
1 parent 37b3c3c commit 3b1c83e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

numpy/_core/tests/test_shape_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ def test_stack():
438438
assert_array_equal(np.stack((a, b)), r1)
439439
assert_array_equal(np.stack((a, b), axis=1), r1.T)
440440
# all input types
441-
assert_array_equal(np.stack(list([a, b])), r1)
441+
assert_array_equal(np.stack([a, b]), r1)
442442
assert_array_equal(np.stack(array([a, b])), r1)
443443
# all shapes for 1d input
444444
arrays = [np.random.randn(3) for _ in range(10)]

numpy/lib/_npyio_impl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2109,7 +2109,7 @@ def genfromtxt(fname, dtype=float, comments='#', delimiter=None,
21092109
user_missing_values = user_missing_values.decode('latin1')
21102110

21112111
# Define the list of missing_values (one column: one list)
2112-
missing_values = [list(['']) for _ in range(nbcols)]
2112+
missing_values = [[''] for _ in range(nbcols)]
21132113

21142114
# We have a dictionary: process it field by field
21152115
if isinstance(user_missing_values, dict):

0 commit comments

Comments
 (0)