[PyQt] Help with PEP 484 Type Hint Stub Files

Damon Lynch damonlynch at gmail.com
Sat Jan 30 18:39:15 GMT 2016


On Sat, Jan 30, 2016 at 10:59 PM, Phil Thompson <phil at riverbankcomputing.com
> wrote:

>
> However, I'm having trouble testing all this. Can anybody recommend a tool
> that has reasonable support for PEP 484 stub files? PyCharm? pytype? mypy?
>
>
Hi Phil,

That's wonderful news! Personally I find the type annotations to be very
useful indeed.

For your testing, PyCharm might be just the ticket:
http://blog.jetbrains.com/pycharm/2015/11/python-3-5-type-hinting-in-pycharm-5/#stub-files

I've not tested PyCharm with stub files myself, but with respect to
in-script type annotating, PyCharm is off to a pretty good start. For
instance it handles this:

self.devices = {}  # type: Dict[int, Device]

but not this, where multiple types are specified:

device, storage_space = index.data(Roles.storage)  # type: Device,
StorageSpace

Best,
Damon
-- 
http://www.damonlynch.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20160130/deac9c98/attachment.html>


More information about the PyQt mailing list