Pattern: Possible unbalanced dict unpacking
Issue: -
Used when there is an unbalanced dict unpacking in assignment or for loop.
Example of incorrect code:
FRUITS = {"apple": 2, "orange": 3, "mellon": 10}
for fruit, price in FRUITS.values(): # [unbalanced-dict-unpacking]
print(fruit)
Example of correct code:
FRUITS = {"apple": 2, "orange": 3, "mellon": 10}
for fruit, price in FRUITS.items():
print(fruit)