8000 [3.8] bpo-39545: Document changes in the support of await in f-strings. (GH-18456) by miss-islington · Pull Request #18505 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.8] bpo-39545: Document changes in the support of await in f-strings. (GH-18456) #18505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Doc/reference/lexical_analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,11 @@ 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.

.. versionchanged:: 3.7
Prior to Python 3.7, an :keyword:`await` expression and comprehensions
containing an :keyword:`async for` clause were illegal in the expressions
in formatted string literals due to a problem with the implementation.

If a conversion is specified, the result of evaluating the expression
is converted before formatting. Conversion ``'!s'`` calls :func:`str` on
the result, ``'!r'`` calls :func:`repr`, and ``'!a'`` calls :func:`ascii`.
Expand Down
5 changes: 5 additions & 0 deletions Doc/whatsnew/3.7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,11 @@ of this mode.
Other Language Changes
======================

* An :keyword:`await` expression and comprehensions containing an
:keyword:`async for` clause were illegal in the expressions in
:ref:`formatted string literals <f-strings>` due to a problem with the
implementation. In Python 3.7 this restriction was lifted.

* More than 255 arguments can now be passed to a function, and a function can
now have more than 255 parameters. (Contributed by Serhiy Storchaka in
:issue:`12844` and :issue:`18896`.)
Expand Down
0