sympy.polys.polytools.poly(expr, *gens, **args) >>> poly(x*(x**2 + x - 1)**2) Poly(x**5 + 2*x**4 - x**3 - 2*x**2 + x, x, domain='ZZ') sympy.polys.polytools.degree(……