pylint #105218 the warning w0102 is not always reported [open]
IssueThe warning w0102 is not always reported. If a function uses dict() or list() instead of {} or [], the warning isn't reported Observed ResultPylint version$ pylint --version No config file found, using default configuration pylint 0.25.2, astng 0.24.0, common 0.58.1 Python 2.7.2+ (default, Oct 4 2011, 20:06:09) [GCC 4.6.1] Python codeimport random def w0102_isnotreported(dictionnary=None): dictionnary = dictionnary or dict() dictionnary[random.randint(1, 500)] = random.randint(1, 5) return dictionnary def w0102_isreported(dictionnary={}): dictionnary[random.randint(1, 500)] = random.randint(1, 5) return dictionnary Pylint output$ pylint -f parseable -d C0111 /tmp/test.py No config file found, using default configuration /tmp/test.py:8: [W, w0102_isreported] Dangerous default value {} as argument Report ====== 10 statements analysed. ... | |
priority | normal |
---|---|
type | bug |
done in | <not specified> |
closed by | <not specified> |