pylint #19802 false positive: Unused argument/variable on augmented assigment [open]
Maarthen reported def exclude(setA, setB): setA -= setB W0613: 1:exclude: Unused argument 'setA' Or a variant with a local variable instead of an argument: def exclude(func, setB): setA = func() setA -= setB W0612: 2:exclude: Unused variable 'setA' It seems that the left side of "-=" is not considered a use of the argument/variable. The same message is issued for integers as for sets, but for sets a function like that can actually be useful while for integers it is not. So one could argue the message make sense for integers and other immutable types where the value is replaced rather than modified (such as "+=" for strings). def subtract(numB): numA = 33 numA -= numB W0612: 2:subtract: Unused variable 'numA' | |
priority | normal |
---|---|
type | bug |
done in | <not specified> |
closed by | <not specified> |
Comments
-
2010/01/21 13:45, written by sthenault
add commentskip: