Skip to content

Commit

Permalink
allow parenthesized yield (generator-coroutines)
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile committed Aug 3, 2022
1 parent 9e6e820 commit 43c5afa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions pycodestyle.py
Expand Up @@ -495,6 +495,7 @@ def missing_whitespace_after_keyword(logical_line, tokens):
tok0.string not in SINGLETONS and
tok0.string not in ('async', 'await') and
not (tok0.string == 'except' and tok1.string == '*') and
not (tok0.string == 'yield' and tok1.string == ')') and
tok1.string not in ':\n'):
yield tok0.end, "E275 missing whitespace after keyword"

Expand Down
4 changes: 4 additions & 0 deletions testsuite/E27.py
Expand Up @@ -52,3 +52,7 @@
#: E275:2:11
if True:
assert(1)
#: Okay
def f():
print((yield))
x = (yield)

0 comments on commit 43c5afa

Please sign in to comment.