Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #94240 > unrolled thread

Re: Generating type annotations by tracing execution runs

Started byChris Angelico <rosuav@gmail.com>
First post2015-07-21 03:18 +1000
Last post2015-07-20 10:34 -0700
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Generating type annotations by tracing execution runs Chris Angelico <rosuav@gmail.com> - 2015-07-21 03:18 +1000
    Re: Generating type annotations by tracing execution runs Paul Rubin <no.email@nospam.invalid> - 2015-07-20 10:34 -0700

#94240 — Re: Generating type annotations by tracing execution runs

FromChris Angelico <rosuav@gmail.com>
Date2015-07-21 03:18 +1000
SubjectRe: Generating type annotations by tracing execution runs
Message-ID<mailman.789.1437412683.3674.python-list@python.org>
On Mon, Jul 20, 2015 at 7:59 PM, Michael Williamson <mike@zwobble.org> wrote:
> I've knocked together a quick proof-of-concept that allows type
> annotations to be automatically added to Python source code by running
> it:
>
>     https://github.com/mwilliamson/farthing
>
> As the code, such as a test suite, runs, the types of arguments and
> return values (for functions in the file/directory to be annotated) are
> stored. After the code has finished, appropriate annotations are added.
> (There's a tiny example in the README.rst in case that makes things a
> little clearer.)

Sounds to me like a type inference system. Can be pretty handy in some
codebases.

ChrisA

[toc] | [next] | [standalone]


#94241

FromPaul Rubin <no.email@nospam.invalid>
Date2015-07-20 10:34 -0700
Message-ID<87a8uqybqt.fsf@jester.gateway.sonic.net>
In reply to#94240
Chris Angelico <rosuav@gmail.com> writes:
>> As the code, such as a test suite, runs, the types of arguments and
>> return values...
> Sounds to me like a type inference system. Can be pretty handy in some
> codebases.

I haven't tried it out yet but it sounds more like the type extraction
part of a JIT compiler, i.e. the types are collected from actual
execution traces rather than statically.  I think of "type inference" as
meaning syntactic inference at compile time.  

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web