Skip to content

Commit 2578a92

Browse files
anntzerlarsoner
authored andcommitted
Py3fy some doctests. (#224)
1 parent bd02bf7 commit 2578a92

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

doc/example.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ def foo(var1, var2, long_var_name='hi'):
112112
use the function.
113113
114114
>>> a = [1, 2, 3]
115-
>>> print [x + 3 for x in a]
115+
>>> print([x + 3 for x in a])
116116
[4, 5, 6]
117-
>>> print "a\n\nb"
117+
>>> print("a\n\nb")
118118
a
119119
b
120120

numpydoc/tests/test_docscrape.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,13 @@
123123
>>> mean = (1,2)
124124
>>> cov = [[1,0],[1,0]]
125125
>>> x = multivariate_normal(mean,cov,(3,3))
126-
>>> print x.shape
126+
>>> print(x.shape)
127127
(3, 3, 2)
128128
129129
The following is probably true, given that 0.6 is roughly twice the
130130
standard deviation:
131131
132-
>>> print list( (x[0,0,:] - mean) < 0.6 )
132+
>>> print(list((x[0, 0, :] - mean) < 0.6))
133133
[True, True]
134134
135135
.. index:: random
@@ -495,13 +495,13 @@ def test_str():
495495
>>> mean = (1,2)
496496
>>> cov = [[1,0],[1,0]]
497497
>>> x = multivariate_normal(mean,cov,(3,3))
498-
>>> print x.shape
498+
>>> print(x.shape)
499499
(3, 3, 2)
500500
501501
The following is probably true, given that 0.6 is roughly twice the
502502
standard deviation:
503503
504-
>>> print list( (x[0,0,:] - mean) < 0.6 )
504+
>>> print(list((x[0, 0, :] - mean) < 0.6))
505505
[True, True]
506506
507507
.. index:: random
@@ -666,13 +666,13 @@ def test_sphinx_str():
666666
>>> mean = (1,2)
667667
>>> cov = [[1,0],[1,0]]
668668
>>> x = multivariate_normal(mean,cov,(3,3))
669-
>>> print x.shape
669+
>>> print(x.shape)
670670
(3, 3, 2)
671671
672672
The following is probably true, given that 0.6 is roughly twice the
673673
standard deviation:
674674
675-
>>> print list( (x[0,0,:] - mean) < 0.6 )
675+
>>> print(list((x[0, 0, :] - mean) < 0.6))
676676
[True, True]
677677
""")
678678

0 commit comments

Comments
 (0)