diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2014-03-26 00:10:13 +0100 |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2014-03-26 00:10:13 +0100 |
commit | 592e49867191ec85fa0ca2e691fb0801f03fe2f5 (patch) | |
tree | 5b1160cc14023fa198f968f6bab83d468178f83f | |
parent | e9218880caa903765864a27fd024a690fe42a31d (diff) | |
download | pep8-592e49867191ec85fa0ca2e691fb0801f03fe2f5.tar.gz |
Review messages for E713 and E714
-rw-r--r-- | docs/intro.rst | 4 | ||||
-rwxr-xr-x | pep8.py | 8 |
2 files changed, 5 insertions, 7 deletions
diff --git a/docs/intro.rst b/docs/intro.rst index 0f1c077..018521d 100644 --- a/docs/intro.rst +++ b/docs/intro.rst @@ -308,9 +308,9 @@ This is the current list of error and warning codes: +----------+----------------------------------------------------------------------+ | E712 (^) | comparison to True should be 'if cond is True:' or 'if cond:' | +----------+----------------------------------------------------------------------+ -| E713 | evaluating membership should be 'elem not in collection' | +| E713 | test for membership should be 'not in' | +----------+----------------------------------------------------------------------+ -| E714 | testing unequal identities should be 'x is not y' | +| E714 | test for object identity should be 'is not' | +----------+----------------------------------------------------------------------+ | E721 | do not compare types, use 'isinstance()' | +----------+----------------------------------------------------------------------+ @@ -986,13 +986,11 @@ def comparison_negative(logical_line): """ match = COMPARE_NEGATIVE_REGEX.search(logical_line) if match: + pos = match.start(1) if match.group(2) == 'in': - msg = ("E713: Use the 'not in' " - "operator for collection membership evaluation") + yield pos, "E713 test for membership should be 'not in'" else: - msg = ("E714: Use the 'is not' " - "operator when testing for unequal identities") - yield match.start(1), msg + yield pos, "E714 test for object identity should be 'is not'" def comparison_type(logical_line): |