Closed
Description
Current problem
Constructing dict
s using the constructor should be avoided. It has no advantages and may be a bit slower.
Invalid code
# construct dict using keywords
dict(foo="bar")
# construct dict using a dict
dict(**boo)
Valid code
# dict literal
{"foo": "bar"}
# casting values to a dict
dict(some_method())
# methods that are not the builtin `dict`
def dict(baz):
...
dict(1)
Desired solution
Create a message that finds and highlights invalid code from above. Maybe as an extension of R1735 use-dict-literal
.
Additional context
No response