Re: [pyweb-il:6213] Adding Python 3 type annotations semi-automatically (fwd)

15 views
Skip to first unread message

Thomas Levine

unread,
Dec 24, 2017, 5:41:23 AM12/24/17
to nista se nece dogoditi
This is tangentially related to Luka's dynamic type checker. It seems
that it records the types of objects that are input to and returned from
calls rather than separately parsing the source code.

It could be interesting to run both the strict dynamic type checker and
the object type logger and look for discrepancies. On the other hand,
it might be uninteresting because it is normal, in Python at least, to
assume that the person using the function knows to pass the correct type
and thus to refrain from checking types unless the input is not trusted.

------- Forwarded Message

Date: Sun, 24 Dec 2017 10:52:49 +0200
From: Alon Levy <al...@pobox.com>
To: Shai Berger <sh...@platonix.com>, "pyweb-il" <pywe...@googlegroups.com
>
Subject: Re: [pyweb-il:6213] Adding Python 3 type annotations semi-automaticall
y

Thanks! very nice, works well.

It doesn't check for base classes btw - i.e. if you have f(x) where it sees x=A and x=B where both A and B share a base class Base it will say f(x: Union[A, B]) instead of f(x:Base), but that can be fixed manually. (also, maybe it has something to do with A and B being defined in cython in my case - not sure yet).

On Sun, Dec 24, 2017, at 12:24 AM, Shai Berger wrote:
> Instagram built, and is now sharing, a tool to do just that.
>
> Thought you might find it interesting.
>
> https://engineering.instagram.com/let-your-code-type-hint-itself-introducing-open-source-monkeytype-a855c7284881

--
You received this message because you are subscribed to the Google Groups "PyWeb-IL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyweb-il+u...@googlegroups.com.
To post to this group, send email to pywe...@googlegroups.com.
Visit this group at https://groups.google.com/group/pyweb-il.
For more options, visit https://groups.google.com/d/optout.

------- End of Forwarded Message
Reply all
Reply to author
Forward
0 new messages