Skip to content

Commit 359edc3

Browse files
authored
Use the Python 3 print() function in the documentation (#11683)
1 parent 024347c commit 359edc3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

doc/usage/restructuredtext/directives.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -544,9 +544,9 @@ __ https://pygments.org/docs/lexers
544544
545545
def some_function():
546546
interesting = False
547-
print 'This line is highlighted.'
548-
print 'This one is not...'
549-
print '...but this one is.'
547+
print('This line is highlighted.')
548+
print('This one is not...')
549+
print('...but this one is.')
550550
551551
.. versionadded:: 1.1
552552
.. versionchanged:: 1.6.6
@@ -576,7 +576,7 @@ __ https://pygments.org/docs/lexers
576576
:caption: this.py
577577
:name: this-py
578578
579-
print 'Explicit is better than implicit.'
579+
print('Explicit is better than implicit.')
580580
581581
In order to cross-reference a code-block using either the
582582
:rst:role:`ref` or the :rst:role:`numref` role, it is necessary

doc/usage/restructuredtext/roles.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,8 @@ different style:
468468
469469
A piece of literal text, such as code. Within the contents, you can use
470470
curly braces to indicate a "variable" part, as in :rst:role:`file`. For
471-
example, in ``:samp:`print 1+{variable}```, the part ``variable`` would be
472-
emphasized: :samp:`print 1+{variable}`
471+
example, in ``:samp:`print(1+{variable})```, the part ``variable`` would be
472+
emphasized: :samp:`print(1+{variable})`
473473

474474
If you don't need the "variable part" indication, use the standard
475475
:rst:role:`code` role instead.

0 commit comments

Comments
 (0)