Skip to content

Commit dfdc5c0

Browse files
committed
Merge pull request #227 from solj/disable-w601
Allow disable of W601
2 parents 0308f2f + 68c13e7 commit dfdc5c0

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

pep8.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,14 +959,16 @@ def comparison_type(logical_line):
959959
yield match.start(), "E721 do not compare types, use 'isinstance()'"
960960

961961

962-
def python_3000_has_key(logical_line):
962+
def python_3000_has_key(logical_line, noqa):
963963
r"""
964964
The {}.has_key() method is removed in the Python 3.
965965
Use the 'in' operation instead.
966966
967967
Okay: if "alph" in d:\n print d["alph"]
968968
W601: assert d.has_key('alph')
969969
"""
970+
if noqa:
971+
return
970972
pos = logical_line.find('.has_key(')
971973
if pos > -1:
972974
yield pos, "W601 .has_key() is deprecated, use 'in'"

0 commit comments

Comments
 (0)