Skip to content

Commit 592e498

Browse files
committed
Review messages for E713 and E714
1 parent e921888 commit 592e498

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

docs/intro.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,9 @@ This is the current list of error and warning codes:
308308
+----------+----------------------------------------------------------------------+
309309
| E712 (^) | comparison to True should be 'if cond is True:' or 'if cond:' |
310310
+----------+----------------------------------------------------------------------+
311-
| E713 | evaluating membership should be 'elem not in collection' |
311+
| E713 | test for membership should be 'not in' |
312312
+----------+----------------------------------------------------------------------+
313-
| E714 | testing unequal identities should be 'x is not y' |
313+
| E714 | test for object identity should be 'is not' |
314314
+----------+----------------------------------------------------------------------+
315315
| E721 | do not compare types, use 'isinstance()' |
316316
+----------+----------------------------------------------------------------------+

pep8.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -986,13 +986,11 @@ def comparison_negative(logical_line):
986986
"""
987987
match = COMPARE_NEGATIVE_REGEX.search(logical_line)
988988
if match:
989+
pos = match.start(1)
989990
if match.group(2) == 'in':
990-
msg = ("E713: Use the 'not in' "
991-
"operator for collection membership evaluation")
991+
yield pos, "E713 test for membership should be 'not in'"
992992
else:
993-
msg = ("E714: Use the 'is not' "
994-
"operator when testing for unequal identities")
995-
yield match.start(1), msg
993+
yield pos, "E714 test for object identity should be 'is not'"
996994

997995

998996
def comparison_type(logical_line):

0 commit comments

Comments
 (0)