# 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 import sage.rings.polynomial.polynomial_ import sage.rings.polynomial.polynomial_element_generic as polynomial_element_generic import sage.rings.rational_field as rational_field from sage.rings.integer_ring import is_IntegerRing, IntegerRing from sage.rings.integer import Integer from sage.libs.pari.all import pari_gen import sage.misc.defaults import sage.misc.latex as latex class PolynomialRing_general(sage.algebr 3/5*x^2 + 2*x + 1 sage: QQ['x'](pari('(-1/3)*x^10 + (2/3)*x - 1/5')) -1/3*x^10 + 2/3*x - 1/5 Coercing strings: sage: QQ['y']('-y') -y """ if is_Element(x): P = x.parent() class PolynomialRing_general(sage.algebr try: from sage.misc.parser import Parser, LookupNameMaker R = self.base_ring() p = Parser(integer.Integer, R, LookupNameMaker({self.variable_name(): self.gen()}, R)) p = Parser(Integer, R, LookupNameMaker({self.variable_name(): self.gen()}, R)) return self(p.parse(x)) except NameError: raise TypeError,"Unable to coerce string"