Convert all print statements in the docs.
diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst
index 045231b..bd55bc9 100644
--- a/Doc/reference/compound_stmts.rst
+++ b/Doc/reference/compound_stmts.rst
@@ -32,13 +32,13 @@
mostly because it wouldn't be clear to which :keyword:`if` clause a following
:keyword:`else` clause would belong: ::
- if test1: if test2: print x
+ if test1: if test2: print(x)
Also note that the semicolon binds tighter than the colon in this context, so
-that in the following example, either all or none of the :keyword:`print`
-statements are executed::
+that in the following example, either all or none of the :func:`print` calls are
+executed::
- if x < y < z: print x; print y; print z
+ if x < y < z: print(x); print(y); print(z)
Summarizing:
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index 6f7e13f..0994ea8 100644
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -376,7 +376,7 @@
generator functions::
>>> def echo(value=None):
- ... print "Execution starts when 'next()' is called for the first time."
+ ... print("Execution starts when 'next()' is called for the first time.")
... try:
... while True:
... try:
@@ -387,15 +387,15 @@
... except Exception, e:
... value = e
... finally:
- ... print "Don't forget to clean up when 'close()' is called."
+ ... print("Don't forget to clean up when 'close()' is called.")
...
>>> generator = echo(1)
- >>> print generator.next()
+ >>> print(generator.next())
Execution starts when 'next()' is called for the first time.
1
- >>> print generator.next()
+ >>> print(generator.next())
None
- >>> print generator.send(2)
+ >>> print(generator.send(2))
2
>>> generator.throw(TypeError, "spam")
TypeError('spam',)
@@ -640,7 +640,7 @@
(and the ``**expression`` argument, if any -- see below). So::
>>> def f(a, b):
- ... print a, b
+ ... print(a, b)
...
>>> f(b=1, *(2,))
2 1
diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst
index fbc626f..6cb9cd1 100644
--- a/Doc/reference/simple_stmts.rst
+++ b/Doc/reference/simple_stmts.rst
@@ -254,7 +254,7 @@
x = [0, 1]
i = 0
i, x[i] = 1, 2
- print x
+ print(x)
.. _augassign: