pylint #65910 Detect comparison of a funciton as an attribute [open]
I occasionally spend a considerable amount of time tracking down brainfarts in my code... while I normally run pylint against it, there are some things that slip past pylint. The easiest problem for me to overlook is this
# normally, variable is populated from parsed text, so it's not predictable variable = 'fOoBaR' if variable.lower == 'foobar': # ^^^^^<------------------ should be .lower() do_something()
I think pylint should bark about this as a potential problem. Specifically, you should never be able to compare a function to a constant in python without getting a warning... in fact, I think you should get a warning on any function as an attribute comparison operation.
|appeared in||<not specified>|
|done in||<not specified>|
|closed by||<not specified>|