[PyQt] Python 3.5 Type Hints

Florian Bruhin me at the-compiler.org
Fri Oct 16 07:27:00 BST 2015


Hi,

Python 3.5 introduced the `typing` module (PEP 484: [1]) for
gradual/optional type checking.

There's also the MyPy checker[2] which seems to start getting
usable to actually run on projects.

For C modules, it requires stub files - here's an example for
lxml.etree: [3]

I think this would be quite useful for PyQt, as most calls to Qt
functions/methods could be type-checked statically with MyPy instead
of raising a TypeError at runtime.

Are there any plans to add such a functionality to sip? If not, I'll
probably attempt to write something based on the XML output, but I got
a bit much on my plate right now :)

Florian

[1] https://www.python.org/dev/peps/pep-0484/
[2] https://github.com/JukkaL/mypy
[3] https://github.com/python/typeshed/blob/master/third_party/3/lxml/etree.pyi

-- 
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: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20151016/ca34b0be/attachment.sig>


More information about the PyQt mailing list