[PyQt] Python 3.5 Type Hints

Phil Thompson phil at riverbankcomputing.com
Fri Oct 16 19:22:44 BST 2015


On 16 Oct 2015, at 7:27 a.m., Florian Bruhin <me at the-compiler.org> wrote:
> 
> 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 :)

It's on the TODO list. I'm not sure yet whether it will sit on top of the XML output or replace it.

Phil


More information about the PyQt mailing list