So, I've generated a list of lists of nested tuples (vectors for a chess move authenticator).
old_v = [[((4, 1, 'P', 'e2'), 1), ((4, 2, '1', 'e3'), 0), ((4, 3, '1', 'e4'), 0), ((4, 4, '1', 'e5'), 0), ((4, 5, '1', 'e6'), 0), ((4, 6, 'q', 'e7'), -1)]]
After reading documentation here and here, I still wasn't able to figure out how to collapse just the tuples from inside each sub-list without rewriting the whole tuple, like this:
new_v = [[(a[b][0][0], a[b][0][1], a[b][0][2], a[b][0][3], a[b][1]) for b in range(0, len(a))] for a in old_v]
print(new_v)
I'd like to know if there's a more Pythonic way to do this.