# ValueError: too many values to unpack

I want try prime ideal factorzation in extension field,how to run [i.L.is_galois() for i, _ in SUB]

ValueError: too many values to unpack

I want try prime ideal factorzation in extension field,how to run [i.L.is_galois() for i, _ in SUB]

add a comment

1

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]

Asked: **
2014-02-14 00:02:24 -0500
**

Seen: **593 times**

Last updated: **Feb 14 '14**

Compute Groebner Basis of an ideal that includes parameters

Convert graph into ideal in polynomial ring

How to implement the multivariable division algorithm without passing to Grobner bases?

Find polynomial in terms of ideal

How to convert (some particular) Sage objects into Macaulay2 ones

Product of primes not dividing $N$ in SAGE.

Non-homogenous Ideals In Unital Associative Free Algebras

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.