# The degree of a poynomial in a quotient ring

Hello,

I am defining a ring, R, two polynomials, p1 and p2, an ideal, I=<p1>, the quotient ring S=R/I, and then I compute p2 in the new ring:

sage: R.<x,y>=QQ[]

sage: p1=x-y

sage:p2=x^2+y^2

sage: I=ideal(p1)

sage: S=R.quotient_ring(I)

sage: q=p2.change_ring(S)

sage: q

2*ybar^2

When I compute the degree of q I get:

sage: d=q.degree()

sage: d

0

and I want to get d=2. Can anybody tell me how can I obtain d=2?