The following source results in a warning, "foo.py:4: Using method (debug) as an attribute (not invoked)". But the debug method is being invoked normally (as can be seen by instantiating the class and calling _got_response with various arguments). I think pychecker is confused by the ternary-if expression, not sure. Tested with pychecker-0.8.19 and Python 2.7.3.
class Foo (object):
def _got_response(self, recvdone):
if recvdone is not None:
self.debug('<-- done ' + ( '(success)' if recvdone is True else repr(recvdone) ))
def debug(self, msg):
Log in to post a comment.