Skip to content

Commit 32c0d40

Browse files
author
Release Manager
committed
Trac #32572: more changes from <type to <class
in many doctests. Sequel of #32299 This remains from python2. Once done in all doctests, one will remove a compatibility layer in doctest parser. URL: https://trac.sagemath.org/32572 Reported by: chapoton Ticket author(s): Frédéric Chapoton Reviewer(s): David Coudert
2 parents f888ee9 + 8d3e539 commit 32c0d40

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+159
-158
lines changed

build/pkgs/configure/checksums.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
tarball=configure-VERSION.tar.gz
2-
sha1=9b22a30a08e51ba00cd1d83434baaefd3185301e
3-
md5=0ac843dd51c77c37da876beae77af4bf
4-
cksum=1637280499
2+
sha1=3d447d16ccee7d1f5a9ebaea31153f98bd1cffa0
3+
md5=6a9015ec510b88f92645f308c2544919
4+
cksum=801814561
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0a4f2a302c23d9c821b7be2cd6a7429075b7da60
1+
2f1dfaa56b98e1e2d9dcf9e048bc6bc302964159

src/sage/algebras/lie_algebras/morphism.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ def __init__(self, on_generators, domain=None, codomain=None, check=True, base_m
499499
sage: L.morphism({X: int(1)})
500500
Traceback (most recent call last):
501501
...
502-
TypeError: codomain <type 'int'> is not a Lie algebra
502+
TypeError: codomain <class 'int'> is not a Lie algebra
503503
504504
sage: from sage.algebras.lie_algebras.morphism import LieAlgebraMorphism_from_generators
505505
sage: LieAlgebraMorphism_from_generators({ZZ(1): X})

src/sage/all.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
Check lazy import of ``interacts``::
4242
4343
sage: type(interacts)
44-
<type 'sage.misc.lazy_import.LazyImport'>
44+
<class 'sage.misc.lazy_import.LazyImport'>
4545
sage: interacts
4646
<module 'sage.interacts.all' from '...'>
4747
"""

src/sage/arith/functions.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,14 @@ cpdef LCM_list(v):
145145
sage: w = LCM_list([3,9,30]); w
146146
90
147147
sage: type(w)
148-
<type 'sage.rings.integer.Integer'>
148+
<class 'sage.rings.integer.Integer'>
149149
150150
The inputs are converted to Sage integers::
151151
152152
sage: w = LCM_list([int(3), int(9), int(30)]); w
153153
90
154154
sage: type(w)
155-
<type 'sage.rings.integer.Integer'>
155+
<class 'sage.rings.integer.Integer'>
156156
157157
TESTS::
158158

src/sage/arith/misc.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ def prime_powers(start, stop=None):
807807
808808
sage: v = prime_powers(10)
809809
sage: type(v[0])
810-
<type 'sage.rings.integer.Integer'>
810+
<class 'sage.rings.integer.Integer'>
811811
812812
sage: prime_powers(0,1)
813813
[]
@@ -1365,9 +1365,9 @@ def random_prime(n, proof=None, lbound=2):
13651365
TESTS::
13661366
13671367
sage: type(random_prime(2))
1368-
<type 'sage.rings.integer.Integer'>
1368+
<class 'sage.rings.integer.Integer'>
13691369
sage: type(random_prime(100))
1370-
<type 'sage.rings.integer.Integer'>
1370+
<class 'sage.rings.integer.Integer'>
13711371
sage: random_prime(1, lbound=-2) #caused Sage hang #10112
13721372
Traceback (most recent call last):
13731373
...
@@ -1715,7 +1715,7 @@ def gcd(a, b=None, **kwargs):
17151715
sage: gcd([])
17161716
0
17171717
sage: type(gcd([]))
1718-
<type 'sage.rings.integer.Integer'>
1718+
<class 'sage.rings.integer.Integer'>
17191719
17201720
TESTS:
17211721
@@ -2963,7 +2963,7 @@ class Euler_Phi:
29632963
sage: euler_phi(0)
29642964
0
29652965
sage: type(euler_phi(0))
2966-
<type 'sage.rings.integer.Integer'>
2966+
<class 'sage.rings.integer.Integer'>
29672967
29682968
We verify directly that the phi function is correct for 21.
29692969
@@ -3472,22 +3472,22 @@ def binomial(x, m, **kwds):
34723472
sage: a = binomial(float(1001), float(1)); a
34733473
1001.0
34743474
sage: type(a)
3475-
<... 'float'>
3475+
<class 'float'>
34763476
sage: binomial(float(1000), 1001)
34773477
0.0
34783478
34793479
Test more output types::
34803480
34813481
sage: type(binomial(5r, 2))
3482-
<... 'int'>
3482+
<class 'int'>
34833483
sage: type(binomial(5, 2r))
3484-
<type 'sage.rings.integer.Integer'>
3484+
<class 'sage.rings.integer.Integer'>
34853485
34863486
sage: type(binomial(5.0r, 2))
3487-
<... 'float'>
3487+
<class 'float'>
34883488
34893489
sage: type(binomial(5/1, 2))
3490-
<type 'sage.rings.rational.Rational'>
3490+
<class 'sage.rings.rational.Rational'>
34913491
34923492
sage: R = Integers(11)
34933493
sage: b = binomial(R(7), R(3))
@@ -5756,7 +5756,7 @@ def squarefree_divisors(x):
57565756
sage: a
57575757
1
57585758
sage: type(a)
5759-
<type 'sage.rings.integer.Integer'>
5759+
<class 'sage.rings.integer.Integer'>
57605760
57615761
Tests with numpy and gmpy2 numbers::
57625762

src/sage/arith/srange.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def srange(*args, **kwds):
223223
sage: v = srange(5); v
224224
[0, 1, 2, 3, 4]
225225
sage: type(v[2])
226-
<type 'sage.rings.integer.Integer'>
226+
<class 'sage.rings.integer.Integer'>
227227
sage: srange(1, 10)
228228
[1, 2, 3, 4, 5, 6, 7, 8, 9]
229229
sage: srange(10, 1, -1)

src/sage/calculus/all.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ def symbolic_expression(x):
5151
sage: a = symbolic_expression(3/2); a
5252
3/2
5353
sage: type(a)
54-
<type 'sage.symbolic.expression.Expression'>
54+
<class 'sage.symbolic.expression.Expression'>
5555
sage: R.<x> = QQ[]; type(x)
56-
<type 'sage.rings.polynomial.polynomial_rational_flint.Polynomial_rational_flint'>
56+
<class 'sage.rings.polynomial.polynomial_rational_flint.Polynomial_rational_flint'>
5757
sage: a = symbolic_expression(2*x^2 + 3); a
5858
2*x^2 + 3
5959
sage: type(a)
60-
<type 'sage.symbolic.expression.Expression'>
60+
<class 'sage.symbolic.expression.Expression'>
6161
sage: from sage.symbolic.expression import is_Expression
6262
sage: is_Expression(a)
6363
True

src/sage/calculus/calculus.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
sage: x^2
4141
x^2
4242
sage: type(x)
43-
<type 'sage.symbolic.expression.Expression'>
43+
<class 'sage.symbolic.expression.Expression'>
4444
4545
More complicated expressions in Sage can be built up using ordinary
4646
arithmetic. The following are valid, and follow the rules of Python

src/sage/calculus/interpolation.pyx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ cdef class Spline:
9191
Traceback (most recent call last):
9292
...
9393
ValueError: Order of derivative must be 1 or 2.
94-
9594
"""
9695
def __init__(self, v=[]):
9796
"""
@@ -100,7 +99,7 @@ cdef class Spline:
10099
sage: S = spline([(1,1), (2,3), (4,5)]); S
101100
[(1, 1), (2, 3), (4, 5)]
102101
sage: type(S)
103-
<type 'sage.calculus.interpolation.Spline'>
102+
<class 'sage.calculus.interpolation.Spline'>
104103
"""
105104
self.v = list(v)
106105
self.started = 0

0 commit comments

Comments
 (0)