diff --git a/pycodestyle.py b/pycodestyle.py index 5c4d5f99..ad3030af 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -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" diff --git a/testsuite/E27.py b/testsuite/E27.py index 5b476577..ca069306 100644 --- a/testsuite/E27.py +++ b/testsuite/E27.py @@ -52,3 +52,7 @@ #: E275:2:11 if True: assert(1) +#: Okay +def f(): + print((yield)) + x = (yield)