We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0308f2f + 68c13e7 commit dfdc5c0Copy full SHA for dfdc5c0
1 file changed
pep8.py
@@ -959,14 +959,16 @@ def comparison_type(logical_line):
959
yield match.start(), "E721 do not compare types, use 'isinstance()'"
960
961
962
-def python_3000_has_key(logical_line):
+def python_3000_has_key(logical_line, noqa):
963
r"""
964
The {}.has_key() method is removed in the Python 3.
965
Use the 'in' operation instead.
966
967
Okay: if "alph" in d:\n print d["alph"]
968
W601: assert d.has_key('alph')
969
"""
970
+ if noqa:
971
+ return
972
pos = logical_line.find('.has_key(')
973
if pos > -1:
974
yield pos, "W601 .has_key() is deprecated, use 'in'"
0 commit comments