a = []
for i in range(10):
for j in range(100):
a.append(j)
ruff version 0.1.0
This rule outputs
test-perf.py:4:9: PERF402 Use `list` or `list.copy` to create a copy of a list
Which while correct in that something should be done here, it really should be calling .extend() not the list or list.copy() constructor. Doing
a = []
for i in range(10):
a = list(range(100))
would yield an invalid result.