Skip to content

Commit

Permalink
Use the Python 3 print() function in the documentation (#11683)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Sep 14, 2023
1 parent 024347c commit 359edc3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions doc/usage/restructuredtext/directives.rst
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,9 @@ __ https://pygments.org/docs/lexers
def some_function():
interesting = False
print 'This line is highlighted.'
print 'This one is not...'
print '...but this one is.'
print('This line is highlighted.')
print('This one is not...')
print('...but this one is.')
.. versionadded:: 1.1
.. versionchanged:: 1.6.6
Expand Down Expand Up @@ -576,7 +576,7 @@ __ https://pygments.org/docs/lexers
:caption: this.py
:name: this-py
print 'Explicit is better than implicit.'
print('Explicit is better than implicit.')
In order to cross-reference a code-block using either the
:rst:role:`ref` or the :rst:role:`numref` role, it is necessary
Expand Down
4 changes: 2 additions & 2 deletions doc/usage/restructuredtext/roles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,8 @@ different style:
A piece of literal text, such as code. Within the contents, you can use
curly braces to indicate a "variable" part, as in :rst:role:`file`. For
example, in ``:samp:`print 1+{variable}```, the part ``variable`` would be
emphasized: :samp:`print 1+{variable}`
example, in ``:samp:`print(1+{variable})```, the part ``variable`` would be
emphasized: :samp:`print(1+{variable})`

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

0 comments on commit 359edc3

Please sign in to comment.