Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
21391: doctest fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rwst committed Mar 7, 2017
1 parent c7f8ad2 commit 9430605
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
7 changes: 6 additions & 1 deletion src/sage/libs/pynac/pynac.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -809,8 +809,13 @@ cdef int py_get_parent_char(o) except -1:
sage: p = next_prime(2^100)
sage: R.<y> = FiniteField(p)[]
sage: y = SR(y)
Traceback (most recent call last):
...
TypeError: Multiplication of symbolic variable and an element of a ring with positive characteristic.
sage: x + y
x + y
Traceback (most recent call last):
...
TypeError: unsupported operand parent(s) for +: ...
sage: p * y
0
"""
Expand Down
9 changes: 4 additions & 5 deletions src/sage/rings/polynomial/laurent_polynomial.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -573,14 +573,13 @@ cdef class LaurentPolynomial_univariate(LaurentPolynomial_generic):
sage: g(x=2)
9
The polynomial does not have to be over a field of
characteristic 0::
The polynomial must be over a field of characteristic 0::
sage: R.<w> = LaurentPolynomialRing(GF(7))
sage: f = SR(2*w^3 + 1); f
2*w^3 + 1
sage: f.variables()
(w,)
Traceback (most recent call last):
...
TypeError: Multiplication of symbolic variable and an element of a ring with positive characteristic.
"""
d = dict([(repr(g), R.var(g)) for g in self.parent().gens()])
return self.subs(**d)
Expand Down
9 changes: 4 additions & 5 deletions src/sage/rings/polynomial/polynomial_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1269,14 +1269,13 @@ cdef class Polynomial(CommutativeAlgebraElement):
sage: g(x=2)
10
The polynomial does not have to be over a field of
characteristic 0::
The polynomial must be over a field of characteristic 0::
sage: R.<w> = GF(7)[]
sage: f = SR(2*w^3 + 1); f
2*w^3 + 1
sage: f.variables()
(w,)
Traceback (most recent call last):
...
TypeError: Multiplication of symbolic variable and an element of a ring with positive characteristic.
"""
d = dict([(repr(g), R.var(g)) for g in self.parent().gens()])
return self.subs(**d)
Expand Down
4 changes: 3 additions & 1 deletion src/sage/rings/polynomial/polynomial_zz_pex.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ cdef class Polynomial_ZZ_pEX(Polynomial_template):
sage: P.<y> = F[]
sage: p = y^4 + x*y^3 + y^2 + (x + 1)*y + x + 1
sage: SR(p) #indirect doctest
y^4 + x*y^3 + y^2 + (x + 1)*y + x + 1
Traceback (most recent call last):
...
TypeError: Multiplication of symbolic variable and an element of a ring with positive characteristic.
sage: p(2)
x + 1
sage: p(y=2)
Expand Down

0 comments on commit 9430605

Please sign in to comment.