Ticket #2347: 2347-doctest.patch

File 2347-doctest.patch, 1.7 KB (added by mhansen, 14 years ago)
  • sage/rings/polynomial/polynomial_ring.py

    # HG changeset patch
    # User Mike Hansen <mhansen@gmail.com>
    # Date 1208216860 25200
    # Node ID 8cc14bb6f14b6df12eb7d6d5e6511cd8f0a3a6d3
    # Parent  8667882edac7f1ca870cb3a24a5d2670b642b00d
    [mq]: 2347-doctest.patch
    
    diff -r 8667882edac7 -r 8cc14bb6f14b sage/rings/polynomial/polynomial_ring.py
    a b import sage.rings.polynomial.polynomial_ 
    7979import sage.rings.polynomial.polynomial_element_generic as polynomial_element_generic
    8080import sage.rings.rational_field as rational_field
    8181from sage.rings.integer_ring import is_IntegerRing, IntegerRing
     82from sage.rings.integer import Integer
    8283from sage.libs.pari.all import pari_gen
    8384import sage.misc.defaults
    8485import sage.misc.latex as latex
    class PolynomialRing_general(sage.algebr 
    200201            3/5*x^2 + 2*x + 1
    201202            sage: QQ['x'](pari('(-1/3)*x^10 + (2/3)*x - 1/5'))
    202203            -1/3*x^10 + 2/3*x - 1/5
     204
     205        Coercing strings:
     206            sage: QQ['y']('-y')
     207            -y
    203208        """
    204209        if is_Element(x):
    205210            P = x.parent()
    class PolynomialRing_general(sage.algebr 
    219224            try:
    220225                from sage.misc.parser import Parser, LookupNameMaker
    221226                R = self.base_ring()
    222                 p = Parser(integer.Integer, R, LookupNameMaker({self.variable_name(): self.gen()}, R))
     227                p = Parser(Integer, R, LookupNameMaker({self.variable_name(): self.gen()}, R))
    223228                return self(p.parse(x))
    224229            except NameError:
    225230                raise TypeError,"Unable to coerce string"