diff options
author | Ian Lee <IanLee1521@gmail.com> | 2015-02-07 16:43:55 -0800 |
---|---|---|
committer | Ian Lee <IanLee1521@gmail.com> | 2015-02-07 16:43:55 -0800 |
commit | d8786cfb5141d1f5cc6afbf26e15ccc773e8934b (patch) | |
tree | f15ec4964ab7544cb2f855fca9cc5c1c8740f682 /pep8.py | |
parent | 6086f61c90c38b5ceb0bf1f473a382fb36f664b1 (diff) | |
parent | 69a3a3da9ed280831787bcecd6ee47caa2969571 (diff) | |
download | pep8-d8786cfb5141d1f5cc6afbf26e15ccc773e8934b.tar.gz |
Merge pull request #313 from hongqn/e721-noqa
allow use # noqa to disable E721 warning
Diffstat (limited to 'pep8.py')
-rwxr-xr-x | pep8.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1053,7 +1053,7 @@ def comparison_negative(logical_line): yield pos, "E714 test for object identity should be 'is not'" -def comparison_type(logical_line): +def comparison_type(logical_line, noqa): r"""Object type comparisons should always use isinstance(). Do not compare types directly. @@ -1069,7 +1069,7 @@ def comparison_type(logical_line): Okay: if type(a1) is type(b1): """ match = COMPARE_TYPE_REGEX.search(logical_line) - if match: + if match and not noqa: inst = match.group(1) if inst and isidentifier(inst) and inst not in SINGLETONS: return # Allow comparison for types which are not obvious |