File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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+----------+----------------------------------------------------------------------+
Original file line number Diff line number Diff 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
998996def comparison_type (logical_line ):
You can’t perform that action at this time.
0 commit comments