galois.Poly.__str__() str

The string representation of the polynomial, without specifying the finite field it’s over.

Tip

Use set_printoptions() to display the polynomial coefficients in degree-ascending order.

Notes

Str() and __str__() are inverse operations.

Examples

In [1]: GF = galois.GF(7)

In [2]: f = galois.Poly([3, 0, 5, 2], field=GF); f
Out[2]: Poly(3x^3 + 5x + 2, GF(7))

In [3]: str(f)
Out[3]: '3x^3 + 5x + 2'

In [4]: print(f)
3x^3 + 5x + 2