comparison contrib/check-code.py @ 29796:6ab838b20359

check-code: allow assignment to hasattr variable
author Yuya Nishihara <yuya@tcha.org>
date Tue, 16 Aug 2016 17:15:54 +0900
parents 24991e7f775f
children 01703a8b8a46
comparison
equal deleted inserted replaced
29795:142ae01820a3 29796:6ab838b20359
293 (r' is\s+(not\s+)?["\'0-9-]', "object comparison with literal"), 293 (r' is\s+(not\s+)?["\'0-9-]', "object comparison with literal"),
294 (r' [=!]=\s+(True|False|None)', 294 (r' [=!]=\s+(True|False|None)',
295 "comparison with singleton, use 'is' or 'is not' instead"), 295 "comparison with singleton, use 'is' or 'is not' instead"),
296 (r'^\s*(while|if) [01]:', 296 (r'^\s*(while|if) [01]:',
297 "use True/False for constant Boolean expression"), 297 "use True/False for constant Boolean expression"),
298 (r'(?:(?<!def)\s+|\()hasattr', 298 (r'(?:(?<!def)\s+|\()hasattr\(',
299 'hasattr(foo, bar) is broken, use util.safehasattr(foo, bar) instead'), 299 'hasattr(foo, bar) is broken, use util.safehasattr(foo, bar) instead'),
300 (r'opener\([^)]*\).read\(', 300 (r'opener\([^)]*\).read\(',
301 "use opener.read() instead"), 301 "use opener.read() instead"),
302 (r'opener\([^)]*\).write\(', 302 (r'opener\([^)]*\).write\(',
303 "use opener.write() instead"), 303 "use opener.write() instead"),