Improve some wording.
This commit is contained in:
parent
eb8155bac5
commit
9143b2852d
|
@ -102,8 +102,8 @@ With an f-string, this becomes::
|
|||
>>> f'The value is {value}.'
|
||||
'The value is 80.'
|
||||
|
||||
f-strings provide a concise, readable way to include expressions
|
||||
inside strings.
|
||||
f-strings provide a concise, readable way to include the value of
|
||||
Python expressions inside strings.
|
||||
|
||||
In this sense, string.Template and %-formatting have similar
|
||||
shortcomings to str.format(), but also support fewer formatting
|
||||
|
@ -643,9 +643,8 @@ having 2 expressions::
|
|||
The same expression used multiple times
|
||||
---------------------------------------
|
||||
|
||||
Every expression in braces in an f-string is evaluated exactly
|
||||
once. If the same expression is used more than once in the same
|
||||
f-string, it will be evaluated multiple times. However, it's undefined
|
||||
Every expression in braces in an f-string is evaluated exactly once
|
||||
for each time it appears in the f-string. However, it's undefined
|
||||
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
|
||||
same literal text defining them. For example, '{i}' and '{i}' are the
|
||||
|
|
Loading…
Reference in New Issue