Use the Python 3 `print()` function in the documentation (#11683)

This commit is contained in:
Hugo van Kemenade 2023-09-14 02:45:20 -06:00 committed by GitHub
parent 024347c285
commit 359edc34fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -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
@ -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

View File

@ -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.