summaryrefslogtreecommitdiffstats
path: root/Doc/library/enum.rst
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/library/enum.rst
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/library/enum.rst')
-rw-r--r--Doc/library/enum.rst3
1 files changed, 2 insertions, 1 deletions
diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst
index 333adfc..b3691ca 100644
--- a/Doc/library/enum.rst
+++ b/Doc/library/enum.rst
@@ -558,7 +558,8 @@ Some rules:
4. %-style formatting: `%s` and `%r` call the :class:`Enum` class's
:meth:`__str__` and :meth:`__repr__` respectively; other codes (such as
`%i` or `%h` for IntEnum) treat the enum member as its mixed-in type.
-5. :meth:`str.format` (or :func:`format`) will use the mixed-in
+5. :ref:`Formatted string literals <f-strings>`, :meth:`str.format`,
+ and :func:`format` will use the mixed-in
type's :meth:`__format__`. If the :class:`Enum` class's :func:`str` or
:func:`repr` is desired, use the `!s` or `!r` format codes.