sourcery icon indicating copy to clipboard operation
sourcery copied to clipboard

Extent `merge-dict-assign` for more than one dictionary

Open Anselmoo opened this issue 1 year ago • 0 comments
trafficstars

Checklist

  • [x] I think this refactoring is useful for everyone (if it's too specific, consider a custom rule)
  • [x] I have checked there are no similar issues suggesting the same thing

Description

Currently, sourcery is only refactoring the first dictionary of several like starting with:

_dict = {}
_dict["A"] = "a"
_dict["B"] = "b"

Code Before

_dict = {"A": "a"}
_dict["B"] = "b"

Code After

_dict =  {"A": "a", "B": "b"}

Anselmoo avatar Sep 22 '24 19:09 Anselmoo