Skip to content

Commit

Permalink
E714: fix changed is not
Browse files Browse the repository at this point in the history
Closes #767
  • Loading branch information
Susannah Klaneček committed May 1, 2020
1 parent a238201 commit f817513
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pycodestyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ def lru_cache(maxsize=128): # noqa as it's a fake implementation.
WHITESPACE_AFTER_COMMA_REGEX = re.compile(r'[,;:]\s*(?: |\t)')
COMPARE_SINGLETON_REGEX = re.compile(r'(\bNone|\bFalse|\bTrue)?\s*([=!]=)'
r'\s*(?(1)|(None|False|True))\b')
COMPARE_NEGATIVE_REGEX = re.compile(r'\b(not)\s+[^][)(}{ ]+\s+(in|is)\s')
COMPARE_NEGATIVE_REGEX = re.compile(r'\b(not)\s+[^][)(}{ ]+\s+(in|is)'
r'\s+(?!not\s)')
COMPARE_TYPE_REGEX = re.compile(r'(?:[=!]=|is(?:\s+not)?)\s+type(?:s.\w+Type'
r'|\s*\(\s*([^)]*[^ )])\s*\))')
KEYWORD_REGEX = re.compile(r'(\s*)\b(?:%s)\b(\s*)' % r'|'.join(KEYWORDS))
Expand Down
6 changes: 6 additions & 0 deletions testsuite/E71.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
#: E714
if not X.B is Y:
pass
#: E714
if not X is Y is not Z:
pass

#
#: Okay
Expand All @@ -79,6 +82,9 @@
if x is not y:
pass

if X is not Y is not Z:
pass

if TrueElement.get_element(True) == TrueElement.get_element(False):
pass

Expand Down

0 comments on commit f817513

Please sign in to comment.