PEP 572: Mention another alternate syntax
This commit is contained in:
parent
868b6f84d8
commit
1129ab3aa3
|
@ -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
|
||||
-------------------------------------
|
||||
|
|
Loading…
Reference in New Issue