Improve some wording.

This commit is contained in:
Eric V. Smith 2015-08-29 16:02:17 -04:00
parent eb8155bac5
commit 9143b2852d
1 changed files with 4 additions and 5 deletions

View File

@ -102,8 +102,8 @@ With an f-string, this becomes::
>>> f'The value is {value}.' >>> f'The value is {value}.'
'The value is 80.' 'The value is 80.'
f-strings provide a concise, readable way to include expressions f-strings provide a concise, readable way to include the value of
inside strings. Python expressions inside strings.
In this sense, string.Template and %-formatting have similar In this sense, string.Template and %-formatting have similar
shortcomings to str.format(), but also support fewer formatting shortcomings to str.format(), but also support fewer formatting
@ -643,9 +643,8 @@ having 2 expressions::
The same expression used multiple times The same expression used multiple times
--------------------------------------- ---------------------------------------
Every expression in braces in an f-string is evaluated exactly Every expression in braces in an f-string is evaluated exactly once
once. If the same expression is used more than once in the same for each time it appears in the f-string. However, it's undefined
f-string, it will be evaluated multiple times. However, it's undefined
which result will show up in the resulting string value. For purposes which result will show up in the resulting string value. For purposes
of this section, two expressions are the same if they have the exact of this section, two expressions are the same if they have the exact
same literal text defining them. For example, '{i}' and '{i}' are the same literal text defining them. For example, '{i}' and '{i}' are the