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

Commit

Permalink
31716: fix doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
videlec committed Apr 22, 2021
1 parent e2a22cb commit 9dbc024
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/sage/rings/polynomial/multi_polynomial.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,28 @@ cdef class MPolynomial(CommutativeRingElement):
sage: RR(ZZ['x,y'].gen(0))
Traceback (most recent call last):
...
TypeError: unable to convert non-constant polynomial x to a real number
TypeError: unable to convert non-constant polynomial x to Real Field with 53 bits of precision
sage: CC(RR['x,y'](0)) # indirect doctest
0.000000000000000
sage: CC(ZZ['x,y'].gen(0))
Traceback (most recent call last):
...
TypeError: unable to convert non-constant polynomial x to a complex number
TypeError: unable to convert non-constant polynomial x to Complex Field with 53 bits of precision
sage: CDF(RR['x,y'](0)) # indirect doctest
0.0
sage: CDF(ZZ['x,y'].gen(0))
Traceback (most recent call last):
...
TypeError: unable to convert non-constant polynomial x to a complex number
TypeError: unable to convert non-constant polynomial x to Complex Double Field
sage: RDF(RR['x,y'](0))
0.0
sage: RDF(ZZ['x,y'].gen(0))
Traceback (most recent call last):
...
TypeError: unable to convert non-constant polynomial x to a real number
TypeError: unable to convert non-constant polynomial x to Real Double Field
sage: x = polygen(QQ)
sage: A.<u> = NumberField(x^3 - 2)
Expand Down Expand Up @@ -104,7 +104,7 @@ cdef class MPolynomial(CommutativeRingElement):
sage: int(ZZ['x,y'].gen(0))
Traceback (most recent call last):
...
TypeError: unable to convert non-constant polynomial x to an integer
TypeError: unable to convert non-constant polynomial x to <class 'int'>
sage: ZZ(RR['x,y'](0)) # indirect doctest
0
Expand All @@ -115,7 +115,7 @@ cdef class MPolynomial(CommutativeRingElement):
sage: ZZ(RR['x,y'].gen(0))
Traceback (most recent call last):
...
TypeError: unable to convert non-constant polynomial x to an integer
TypeError: unable to convert non-constant polynomial x to Integer Ring
"""
return self._scalar_conversion(int)

Expand All @@ -128,7 +128,7 @@ cdef class MPolynomial(CommutativeRingElement):
sage: float(ZZ['x,y'].gen(0))
Traceback (most recent call last):
...
TypeError: unable to convert non-constant polynomial x to a float
TypeError: unable to convert non-constant polynomial x to <class 'float'>
"""
return self._scalar_conversion(float)

Expand All @@ -141,7 +141,7 @@ cdef class MPolynomial(CommutativeRingElement):
sage: QQ(RR['x,y'].gen(0))
Traceback (most recent call last):
...
TypeError: unable to convert non-constant polynomial x to a rational
TypeError: unable to convert non-constant polynomial x to Rational Field
"""
from sage.rings.rational_field import QQ
return self._scalar_conversion(QQ)
Expand Down Expand Up @@ -1952,7 +1952,7 @@ cdef class MPolynomial(CommutativeRingElement):
sage: p.weighted_degree(x,1,1)
Traceback (most recent call last):
...
TypeError: unable to convert non-constant polynomial x to an integer
TypeError: unable to convert non-constant polynomial x to Integer Ring
sage: p.weighted_degree(2/1,1,1)
6
Expand Down

0 comments on commit 9dbc024

Please sign in to comment.