mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-20 14:59:27 +00:00
Enforce more ruff rules (#5922)
* Apply ruff/flake8-implicit-str-concat rule ISC003 ISC003 Explicitly concatenated string should be implicitly concatenated * Enforce ruff/flake8-implicit-str-concat rules (ISC) * Apply ruff/Perflint rule PERF102 PERF102 When using only the values of a dict use the `values()` method * Apply ruff/Perflint rule PERF401 PERF401 Use a list comprehension to create a transformed list * Enforce ruff/Perflint rules (PERF)
This commit is contained in:
committed by
GitHub
parent
1c1d01c8a1
commit
6651530963
@@ -258,7 +258,7 @@ def test_noncopyable_containers():
|
||||
assert nvnc[i][j].value == j + 1
|
||||
|
||||
# Note: maps do not have .values()
|
||||
for _, v in nvnc.items():
|
||||
for v in nvnc.values():
|
||||
for i, j in enumerate(v, start=1):
|
||||
assert j.value == i
|
||||
|
||||
@@ -269,7 +269,7 @@ def test_noncopyable_containers():
|
||||
assert nmnc[i][j].value == 10 * j
|
||||
|
||||
vsum = 0
|
||||
for _, v_o in nmnc.items():
|
||||
for v_o in nmnc.values():
|
||||
for k_i, v_i in v_o.items():
|
||||
assert v_i.value == 10 * k_i
|
||||
vsum += v_i.value
|
||||
@@ -283,7 +283,7 @@ def test_noncopyable_containers():
|
||||
assert numnc[i][j].value == 10 * j
|
||||
|
||||
vsum = 0
|
||||
for _, v_o in numnc.items():
|
||||
for v_o in numnc.values():
|
||||
for k_i, v_i in v_o.items():
|
||||
assert v_i.value == 10 * k_i
|
||||
vsum += v_i.value
|
||||
|
||||
Reference in New Issue
Block a user