[Python-checkins] cpython (merge 3.5 -> default): merge with 3.5

georg.brandl python-checkins at python.org
Mon Feb 22 08:53:08 EST 2016


https://hg.python.org/cpython/rev/cbf83f55d5f3
changeset:   100301:cbf83f55d5f3
parent:      100299:365ab6287783
parent:      100300:6b502158acc8
user:        Georg Brandl <georg at python.org>
date:        Mon Feb 22 14:53:03 2016 +0100
summary:
  merge with 3.5

files:
  Doc/tutorial/inputoutput.rst |  10 +++++-----
  1 files changed, 5 insertions(+), 5 deletions(-)


diff --git a/Doc/tutorial/inputoutput.rst b/Doc/tutorial/inputoutput.rst
--- a/Doc/tutorial/inputoutput.rst
+++ b/Doc/tutorial/inputoutput.rst
@@ -153,11 +153,11 @@
 ``'!a'`` (apply :func:`ascii`), ``'!s'`` (apply :func:`str`) and ``'!r'``
 (apply :func:`repr`) can be used to convert the value before it is formatted::
 
-   >>> import math
-   >>> print('The value of PI is approximately {}.'.format(math.pi))
-   The value of PI is approximately 3.14159265359.
-   >>> print('The value of PI is approximately {!r}.'.format(math.pi))
-   The value of PI is approximately 3.141592653589793.
+   >>> contents = 'eels'
+   >>> print('My hovercraft is full of {}.'.format(contents))
+   My hovercraft is full of eels.
+   >>> print('My hovercraft is full of {!r}.'.format(contents))
+   My hovercraft is full of 'eels'.
 
 An optional ``':'`` and format specifier can follow the field name. This allows
 greater control over how the value is formatted.  The following example

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list