[Python-projects] W0104 False positive (function_call() and other_function_call())

Duncan Findlay duncf at debian.org
Mon Jan 12 20:49:07 CET 2009


Hi all,

I'm working on some new checkers to fit our local Python style  
guidelines, and I found a false positive with W0104 ("Statement seems  
to have no effect"). I'm running python 2.5 on mercurial tip.

This code exhibits a false positive:
some_function() and some_other_function()

Granted, it's dirty and shouldn't be done, (I'm adding a message for  
it in my code...) but it shouldn't lead to a W0104. My guess is that  
instead of checking that a discard node's expr attribute is a Yield or  
CallFunc node, we should also check if a child node is one of those.

Thanks

Duncan


More information about the Python-Projects mailing list