(p, x)
return False
test if ``p`` has a constant term in ``x``

    Examples
    ========

    >>> from sympy.polys.domains import QQ
    >>> from sympy.polys.rings import ring
    >>> from sympy.polys.ring_series import _has_constant_term
    >>> R, x = ring('x', QQ)
    >>> p = x**2 + x + 1
    >>> _has_constant_term(p, x)
    True
test if ``p`` has a constant term in ``x``
test if p has a constant term in x
def _has_constant_term(p, x):
    """
    test if ``p`` has a constant term in ``x``

    Examples
    ========

    >>> from sympy.polys.domains import QQ
    >>> from sympy.polys.rings import ring
    >>> from sympy.polys.ring_series import _has_constant_term
    >>> R, x = ring('x', QQ)
    >>> p = x**2 + x + 1
    >>> _has_constant_term(p, x)
    True
    """
    ring = p.ring
    iv = ring.gens.index(x)
    zm = ring.zero_monom
    a = [0]*ring.ngens
    a[iv] = 1
    miv = tuple(a)
    for expv in p:
        if monomial_min(expv, miv) == zm:
            return True
    return False
def _has_constant_term ( p , x ) : ring = p . ring iv = ring . gens . index ( x ) zm = ring . zero_monom a = [ 0 ] * ring . ngens a [ iv ] = 1 miv = tuple ( a ) for expv in p : if monomial_min ( expv , miv ) == zm : return True return False