Simple convert of dict-constructor to dict-literal, comply with PyLint use-dict-literal / R1735 #6227
dmakhno
started this conversation in
Enhancement
Replies: 2 comments
-
Additional repro to mentioned in pylint link... a = dict(
b=dict(
c=1,
d=2,
),
l=[
dict(
x=3,
y=4,
)
]
) complains
Expectations of pylint, and this FR to be able it from a = {
"b": ...,
"l": [...],
}
# b as
{
"c": 1,
"d": 2,
}
# l item as
{
"x": 3,
"y": 4,
} It can be recursive - once for root |
Beta Was this translation helpful? Give feedback.
0 replies
-
Transferring to discussions for up votes. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Due to performance reasons pylint suggest a lot to refactor dict to literal form.
https://pylint.readthedocs.io/en/latest/user_guide/messages/refactor/use-dict-literal.html
It is straight forward action in most case, but human-time consuming.
Would be nice to have it from the box.
I cannot find any extension that supports it, neither other FRs.
Also I used other "brainy" IDE, where this feature exist for a long time, and very missing it vscode. At least in form to make pylint happy.
Beta Was this translation helpful? Give feedback.
All reactions