Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In order to unpack multiple values by multiple assignments in python 2.7 you need as many variables as values to unpack.

In your example, the elements of SUB are tuples of three elements, so you would have to do

for i, _ , _ in SUB

Yes, you can put the same variable multiple times, try to understand what python does with

a, b, b, a = range(4)

On the other hand, "i" will not have a method called "L", so you probably want

[i.is_galois() for i, _, _ in SUB]

Or, even better, avoid multiple assignment usign:

[i[0].is_galois() for i in SUB]