Pattern: Unbalanced tuple unpacking
Issue: -
Used when there is an unbalanced tuple unpacking in assignment. Sequence unpacking requires the list of variables on the left to have the same number of elements as the length of the sequence.
Example of incorrect code:
def do_stuff():
first, second = 1, 2, 3 # last tuple value has no matching element
return first + second
Example of correct code:
def do_stuff():
first, second = 1, 2
return first + second