(p1, p2)
Equality test for polynomials.

        Examples
        --------
        >>> from sympy.polys.domains import ZZ
        >>> from sympy.polys.rings import ring

        >>> _, x, y = ring('x, y', ZZ)
        >>> p1 = (x + y)**2 + (x - y)**2
        >>> p1 == 4*x*y
        False
        >>> p1 == 2*(x**2 + y**2)
        True
Equality test for polynomials.
Equality test for polynomials .
def __eq__(p1, p2):
        """Equality test for polynomials.

        Examples
        --------
        >>> from sympy.polys.domains import ZZ
        >>> from sympy.polys.rings import ring

        >>> _, x, y = ring('x, y', ZZ)
        >>> p1 = (x + y)**2 + (x - y)**2
        >>> p1 == 4*x*y
        False
        >>> p1 == 2*(x**2 + y**2)
        True

        """
        if not p2:
            return not p1
        elif isinstance(p2, p1.ring.dtype):
            return dict.__eq__(p1, p2)
        elif len(p1) > 1:
            return False
        else:
            return p1.get(p1.ring.zero_monom) == p2
def __eq__ ( p1 , p2 ) : if not p2 : return not p1 elif isinstance ( p2 , p1 . ring . dtype ) : return dict . __eq__ ( p1 , p2 ) elif len ( p1 ) > 1 : return False else : return p1 . get ( p1 . ring . zero_monom ) == p2