PEP 572: Mention another alternate syntax

This commit is contained in:
Chris Angelico 2018-04-16 06:42:37 +10:00
parent 868b6f84d8
commit 1129ab3aa3
1 changed files with 9 additions and 0 deletions

View File

@ -330,6 +330,15 @@ Broadly the same semantics as the current proposal, but spelled differently.
is repurposed (most likely ``with:``). See PEP 3150 for prior discussion
on this subject (with the proposed keyword being ``given:``).
5. ``TARGET from EXPR``::
stuff = [[y from f(x), x/y] for x in range(5)]
This syntax has fewer conflicts than ``as`` does (conflicting only with the
``raise Exc from Exc`` notation), but is otherwise comparable to it. Instead
of paralleling ``with expr as target:`` (which can be useful but can also be
confusing), this has no parallels, but is evocative.
Special-casing conditional statements
-------------------------------------