summaryrefslogtreecommitdiffstats
path: root/Doc/faq
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-02-13 00:41:37 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-02-13 00:41:37 (GMT)
commitbc1ee460dcbe5811ebb10a6cacd8d3670846f039 (patch)
tree1ce59d900fa4173482085eeca44bfe864336534a /Doc/faq
parente0b23095ee03a11d09f38cbc689307dc5c93afda (diff)
downloadcpython-bc1ee460dcbe5811ebb10a6cacd8d3670846f039.zip
cpython-bc1ee460dcbe5811ebb10a6cacd8d3670846f039.tar.gz
cpython-bc1ee460dcbe5811ebb10a6cacd8d3670846f039.tar.bz2
Issue #25179: Documentation for formatted string literals aka f-strings
Some of the inspiration and wording is taken from the text of PEP 498 by Eric V. Smith, and the existing str.format() documentation.
Diffstat (limited to 'Doc/faq')
-rw-r--r--Doc/faq/programming.rst3
1 files changed, 2 insertions, 1 deletions
diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst
index 9fba9fe..7b529a1 100644
--- a/Doc/faq/programming.rst
+++ b/Doc/faq/programming.rst
@@ -839,7 +839,8 @@ How do I convert a number to a string?
To convert, e.g., the number 144 to the string '144', use the built-in type
constructor :func:`str`. If you want a hexadecimal or octal representation, use
the built-in functions :func:`hex` or :func:`oct`. For fancy formatting, see
-the :ref:`formatstrings` section, e.g. ``"{:04d}".format(144)`` yields
+the :ref:`f-strings` and :ref:`formatstrings` sections,
+e.g. ``"{:04d}".format(144)`` yields
``'0144'`` and ``"{:.3f}".format(1.0/3.0)`` yields ``'0.333'``.