Hi!

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

(paste: http://paste.the-compiler.org/view/1970b9b8)

However, the breakpoint never hits. Why is that?

Florian

-- 
http://www.the-compiler.org | m...@the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://email.is-not-s.ms/

Attachment: pgpa4YPqLzZ1O.pgp
Description: PGP signature

_______________________________________________
code-quality mailing list
code-quality@python.org
https://mail.python.org/mailman/listinfo/code-quality

Reply via email to