I'm trying to write a checker for pylint which checks if certain callables (anything passed to the .connect() method of a pyqtSignal, i.e. Qt slots) are decorated with @pyqtSlot.
However I'm already stuck trying to implement a visit_callfunc which actually sees the call.
My checker does this:
def visit_callfunc(self, node): if hasattr(node, 'func'): if getattr(node.func, 'name', None) == 'connect': import pdb; pdb.set_trace()
(full source: http://paste.the-compiler.org/view/32c1b8df)
This is the code I'm testing with:
from PyQt5.QtCore import QObject, pyqtSignal
class Foo(QObject): sig = pyqtSignal() def __init__(self): self.sig.connect(func)
def func(): pass
However, the breakpoint never hits. Why is that?