Skip to content

Commit f31cc56

Browse files
MAINT: Apply ruff/flake8-comprehensions rule C414
C414 Unnecessary `list` call within `sorted()`
1 parent 3b1c83e commit f31cc56

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

benchmarks/benchmarks/bench_linalg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def time_tensordot_a_b_axes_1_0_0_1(self):
7272

7373

7474
class Linalg(Benchmark):
75-
params = sorted(list(set(TYPES1) - set(['float16'])))
75+
params = sorted(set(TYPES1) - set(['float16']))
7676
param_names = ['dtype']
7777

7878
def setup(self, typename):

numpy/_core/einsumfunc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ def einsum_path(*operands, optimize='greedy', einsum_call=False):
964964
# Build contraction tuple (positions, gemm, einsum_str, remaining)
965965
for cnum, contract_inds in enumerate(path):
966966
# Make sure we remove inds from right to left
967-
contract_inds = tuple(sorted(list(contract_inds), reverse=True))
967+
contract_inds = tuple(sorted(contract_inds, reverse=True))
968968

969969
contract = _find_contraction(contract_inds, input_sets, output_set)
970970
out_inds, input_sets, idx_removed, idx_contract = contract

0 commit comments

Comments
 (0)