[PyQt] Help with PEP 484 Type Hint Stub Files

Damon Lynch damonlynch at gmail.com
Sat Feb 6 09:30:01 GMT 2016


On Sat, Feb 6, 2016 at 5:22 AM, oliver <oliver.schoenborn at gmail.com> wrote:

> I use annotations a lot on my projects and could test too if that helps
> On Feb 5, 2016 12:06 PM, "Phil Thompson" <phil at riverbankcomputing.com>
> wrote:
>
>> On 30 Jan 2016, at 6:39 pm, Damon Lynch <damonlynch at gmail.com> wrote:
>> >
>> >
>> > 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
>>
>> Would you be able to test it if I sent you some stub files?
>>
>>

I'm happy to help. FWIW, all my code is PyQt 5, and I never develop with
PyQt 4.
-- 
http://www.damonlynch.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20160206/3ddda80b/attachment.html>


More information about the PyQt mailing list