diff options
author | Ian Stapleton Cordasco <graffatcolmingov@gmail.com> | 2019-03-01 15:40:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-01 15:40:31 -0500 |
commit | 1a3f827883c9029c4724b2fc70cb733a5f8317d5 (patch) | |
tree | def165563f5b1985f7bec9522250fc97794d85d5 | |
parent | d1e29861597f22d01e0f528aaccdb744d5bade81 (diff) | |
parent | 0327e55e756e20ade468e67992f9f43da14aabb4 (diff) | |
download | pep8-1a3f827883c9029c4724b2fc70cb733a5f8317d5.tar.gz |
Merge pull request #850 from asottile/E721_false_positive
Fix E721 false positive
-rwxr-xr-x | pycodestyle.py | 2 | ||||
-rw-r--r-- | testsuite/E72.py | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/pycodestyle.py b/pycodestyle.py index 02a717a..cad68ea 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -139,7 +139,7 @@ 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_TYPE_REGEX = re.compile(r'(?:[=!]=|is(?:\s+not)?)\s*type(?:s.\w+Type' +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)) OPERATOR_REGEX = re.compile(r'(?:[^,\s])(\s*)(?:[-+*/|!<=>%&^]+)(\s*)') diff --git a/testsuite/E72.py b/testsuite/E72.py index c18527f..a60d892 100644 --- a/testsuite/E72.py +++ b/testsuite/E72.py @@ -49,6 +49,9 @@ if isinstance(res, types.MethodType): pass if type(a) != type(b) or type(a) == type(ccc): pass +#: Okay +def func_histype(a, b, c): + pass #: E722 try: pass |