[PyQt] Getting a list of virtual PyQt functions

Florian Bruhin me at the-compiler.org
Thu Jul 16 10:49:23 BST 2015


Hi!

I recently found out about vulture[1], which is a static checker to
find dead Python code, among other things it finds methods which never
are called.

However, it (naturally) doesn't detect when I'm overriding a virtual
Qt function, as that's never called *from Python*.

I opened an issue [2] and we agreed it'd be a good idea to add a
whitelist for all virtual PyQt methods.

Of course maintaining such a whitelist by hand is not something I want
to do, so I looked into sip and how it could help me.

I found out about the XML export (-m), and have two questions about
it:

- Is there a reason it's not documented at [3]?

- Would a patch adding a 'virtual="true"' attribute to function tags
  if isVirtual() is true be appreciated?

Thanks,

Florian

[1] https://bitbucket.org/jendrikseipp/vulture/overview
[2] https://bitbucket.org/jendrikseipp/vulture/issues/8/overriden-methods-of-c-c-extensions
[3] http://pyqt.sourceforge.net/Docs/sip4/command_line.html

-- 
http://www.the-compiler.org | me at 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/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150716/0dc70774/attachment.sig>


More information about the PyQt mailing list