diff options
author | Susannah Klaneček <suzil@protonmail.ch> | 2020-05-01 12:40:11 -0400 |
---|---|---|
committer | Susannah Klaneček <suzil@protonmail.ch> | 2020-05-01 12:40:11 -0400 |
commit | 39895aae46a2a4b665fc85a3747f2fafd27441fa (patch) | |
tree | 555e9d5c87b81a7a0ca0df328d4b303a3cdbdcc8 | |
parent | 5230110c339133b2da060ef3f5c04a55c40fc096 (diff) | |
download | pep8-39895aae46a2a4b665fc85a3747f2fafd27441fa.tar.gz |
Handle
-rwxr-xr-x | pycodestyle.py | 4 | ||||
-rw-r--r-- | testsuite/E71.py | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/pycodestyle.py b/pycodestyle.py index b1fb8a7..d9682b8 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -140,8 +140,8 @@ EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[\[({] | [\]}),;]| :(?!=)') 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)' - r'\s+(?!not\s)') +COMPARE_NEGATIVE_REGEX = re.compile(r'\b(?<!is\s)(not)\s+[^][)(}{ ]+\s+' + r'(in|is)\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)) diff --git a/testsuite/E71.py b/testsuite/E71.py index e7f8869..abf4e7a 100644 --- a/testsuite/E71.py +++ b/testsuite/E71.py @@ -67,6 +67,9 @@ if not X.B is Y: #: E714 if not X is Y is not Z: pass +#: E714 +if not X is not Y: + pass # #: Okay |