diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-02-08 01:34:09 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-02-08 01:34:09 (GMT) |
commit | d5db14794bdeb4646ede5881aed43dd1838ffe7a (patch) | |
tree | 867cd7b301dd19e4db74e191281398ae40d00782 /Doc/library/enum.rst | |
parent | b6213c5664cf983ae67059a41520af1aaeeb52c3 (diff) | |
download | cpython-d5db14794bdeb4646ede5881aed43dd1838ffe7a.zip cpython-d5db14794bdeb4646ede5881aed43dd1838ffe7a.tar.gz cpython-d5db14794bdeb4646ede5881aed43dd1838ffe7a.tar.bz2 |
Issue #25179: Preparatory cleanup of existing docs on string formatting
* Various sections were pointing to the section on the string.Formatter
class, when the section on the common format string syntax is probably more
appropriate
* Fix references to various format() functions and methods
* Nested replacement fields may contain conversions and format specifiers,
and this is tested; see Issue #19729 for instance
Diffstat (limited to 'Doc/library/enum.rst')
-rw-r--r-- | Doc/library/enum.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index 81f97b3..8a02a55 100644 --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -555,12 +555,12 @@ Some rules: 3. When another data type is mixed in, the :attr:`value` attribute is *not the same* as the enum member itself, although it is equivalent and will compare equal. -4. %-style formatting: `%s` and `%r` call :class:`Enum`'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 - type's :meth:`__format__`. If the :class:`Enum`'s :func:`str` or - :func:`repr` is desired use the `!s` or `!r` :class:`str` format codes. +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 + type's :meth:`__format__`. If the :class:`Enum` class's :func:`str` or + :func:`repr` is desired, use the `!s` or `!r` format codes. Interesting examples |