Skip to content

Commit e06ff6b

Browse files
committed
Resolve review
1 parent ca8b607 commit e06ff6b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Doc/library/stdtypes.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2512,7 +2512,7 @@ can contain any Python expression:
25122512
.. code-block:: pycon
25132513
25142514
>>> nationality = 'Spanish'
2515-
>>> f'The {name} Inquisition!'
2515+
>>> f'The {nationality} Inquisition!'
25162516
'The Spanish Inquisition!'
25172517
25182518
To include a literal ``{`` or ``}``, use a double bracket:
@@ -2583,11 +2583,13 @@ For example:
25832583
Once the output has been evaluated, it can be formatted using a
25842584
:ref:`format specifier <formatstrings>` following a colon (``':'``).
25852585
After the expression has been evaluated, and possibly converted to a string,
2586-
the :meth:`__format__` method of the result is called with the format specifier,
2586+
the :meth:`!__format__` method of the result is called with the format specifier,
25872587
or the empty string if no format specifier is given.
25882588
The formatted result is then used as the final value for the replacement field.
25892589
For example:
25902590

2591+
.. code-block:: pycon
2592+
25912593
>>> from fractions import Fraction
25922594
>>> f'{Fraction(1, 7):.6f}'
25932595
'0.142857'

0 commit comments

Comments
 (0)