Ticket #6036: trac_6036.patch

File trac_6036.patch, 1.1 KB (added by mhansen, 12 years ago)
  • sage/rings/polynomial/multi_polynomial.pyx

    # HG changeset patch
    # User Kwankyu Lee <ekwankyu@gmail.com>
    # Date 1242280187 -32400
    # Branch base_symbolics
    # Node ID 05e1ce678ca0b16d71d5169e9a801588037a8095
    # Parent  db99b6a9fd4838513c0f7716fb95afe679ecb566
    Trac #6036: a bug in polynomial() for PolynomialRing(GF(5),2)
    
    diff --git a/sage/rings/polynomial/multi_polynomial.pyx b/sage/rings/polynomial/multi_polynomial.pyx
    a b  
    375375            z^5 + x*w*k*z + w^5 + 17*x*w^3 + x^3 + 3*x*w + 5
    376376            sage: f.polynomial(k)
    377377            x*w*z*k + w^5 + z^5 + 17*x*w^3 + x^3 + 3*x*w + 5
     378            sage: R.<x,y>=GF(5)[]
     379            sage: f=x^2+x+y
     380            sage: f.polynomial(x)
     381            x^2 + x + y
     382            sage: f.polynomial(y)
     383            y + x^2 + x
    378384        """
    379385        cdef int ind
    380386        R = self.parent()
     
    961967cdef remove_from_tuple(e, int ind):
    962968    w = list(e)
    963969    del w[ind]
    964     return tuple(w)
     970    if len(w) == 1:
     971        return w[0]
     972    else:
     973        return tuple(w)
    965974