Skip to content

Commit c97e4f8

Browse files
authored
Merge pull request #1091 from asottile/E275-yield-expression
allow parenthesized yield (generator-coroutines)
2 parents 9e6e820 + 43c5afa commit c97e4f8

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

pycodestyle.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ def missing_whitespace_after_keyword(logical_line, tokens):
495495
tok0.string not in SINGLETONS and
496496
tok0.string not in ('async', 'await') and
497497
not (tok0.string == 'except' and tok1.string == '*') and
498+
not (tok0.string == 'yield' and tok1.string == ')') and
498499
tok1.string not in ':\n'):
499500
yield tok0.end, "E275 missing whitespace after keyword"
500501

testsuite/E27.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,7 @@
5252
#: E275:2:11
5353
if True:
5454
assert(1)
55+
#: Okay
56+
def f():
57+
print((yield))
58+
x = (yield)

0 commit comments

Comments
 (0)