On Mon, Nov 6, 2017 at 11:34 AM, Stéfane Fermigier firstname.lastname@example.org wrote:
Now I believe something could be done along the lines:
a) record runtime type information from test or regular runs b) massage these information and use them to annotate Python code with additional type information (up to the developer to then accept or not the proposed changes) c) also run a test suite or an app under some magical machinery, and either raise a TypeError or log warnings when discrepancies are detected between type annotation and runtime behaviour.
[...] (a) and (b) would use similar machinery,
I mean, (a) and (c)
and (a), (b) and (c) would be probably a useful way to introduce type annotations to an existing code base without too much risk.
(a) and (b) could also provide data for an interesting SE research project.
Similar to "Measuring Polymorphism in Python Programs", by Beatrice Akerblom and Tobias Wrigstad: https://people.dsv.su.se/%7Ebeatrice/python/dls15_large_images.pdf