ruff
ruff copied to clipboard
Encourage dict/list creation through constructor
a = {} # or a = dict()
a["a"] = 1
a["b"] = 2
b = []
b.append(1)
b.append(2)
should be
a = {"a": 1, "b": 2}
b = [1, 2]
I thought there was already a rule in ruff for that but ruff check --select ALL
didn't point them out
Also should cover .extend
calls for lists, and .update
calls for sets and dicts.