On Thursday 04 February 2010 14:15:33 Sam Tygier wrote:
> hello
>
> i wonder if pylint could be made to spot the following error
>
> if ans.lower in ["yes", "y"]:
>
> where the function is compared, rather than calling the function and
> comparing the result.
>
> maybe it could check for any comparison between a function and a
> literal.
It can't possibly know that lower is a function instead of a simple string.
class Foo(object):
lower = "yes"
ans = Foo()
if ans.lower in ["yes", "y"]:
print "yieha"
Diez
_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects