Ask Your Question

Revision history [back]

The error seems to be that one of the "pairs" has more than two elements.

To debug, you could try replacing

        f,g = pairs.pop()

with

        fg = pairs.pop()
        try:
            f, g = fg
        except ValueError:
            print(f'Error assigning "pair": f, g = {fg}')
            raise