Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
ae2c32f3
Commit
ae2c32f3
authored
May 06, 2019
by
Logan Jones
Committed by
Guido van Rossum
May 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-36798: Updating f-string docs for := use case (GH-13107)
parent
f7b494c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
Doc/reference/lexical_analysis.rst
Doc/reference/lexical_analysis.rst
+6
-5
No files found.
Doc/reference/lexical_analysis.rst
View file @
ae2c32f3
...
...
@@ -680,11 +680,12 @@ with a closing curly bracket ``'}'``.
Expressions in formatted string literals are treated like regular
Python expressions surrounded by parentheses, with a few exceptions.
An empty expression is not allowed, and a :keyword:`lambda` expression
must be surrounded by explicit parentheses. Replacement expressions
can contain line breaks (e.g. in triple-quoted strings), but they
cannot contain comments. Each expression is evaluated in the context
where the formatted string literal appears, in order from left to right.
An empty expression is not allowed, and both :keyword:`lambda` and
assignment expressions ``:=`` must be surrounded by explicit parentheses.
Replacement expressions can contain line breaks (e.g. in triple-quoted
strings), but they cannot contain comments. Each expression is evaluated
in the context where the formatted string literal appears, in order from
left to right.
If a conversion is specified, the result of evaluating the expression
is converted before formatting. Conversion ``'!s'`` calls :func:`str` on
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment