Format ExprYield/ExprYieldFrom (#5921)

Co-authored-by: Micha Reiser <micha@reiser.io>
This commit is contained in:
qdegraaf 2023-07-21 14:07:51 +02:00 committed by GitHub
parent c3b506fca6
commit 519dbdffaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 373 additions and 185 deletions

View file

@ -0,0 +1,59 @@
l = [1,2,3,4]
def foo():
yield l
b = yield l
c = [
(yield l) , (
yield l
)]
with (
# Some comment
yield
):
pass
if (yield):
# comment
pass
(yield a, b) = (1, 2)
# some comment
for e in l : yield e # some comment
for e in l:
# some comment
yield e
# trail comment
for e in l:
# comment
yield (((((((e))))))) # Too many parentheses
# comment
for ridiculouslylongelementnameeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee in l:
yield ridiculouslylongelementnameeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
for x in l: #comment
yield x + (2 * 4) # trailing comment
while (
yield l
):
pass
yield from (yield l)

View file

@ -0,0 +1,35 @@
l = [1,2,3,4]
def foo():
yield from l # some comment
# weird indents
yield\
from\
l
# indented trailing comment
a = yield from l
with (
# Comment
yield from l
# Comment
):
pass
c = [(yield from l) , (
yield from l
)]
while (
yield from l
):
pass
yield (
yield from l
)