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


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

Generating type annotations by tracing execution runs

Started byMichael Williamson <mike@zwobble.org>
First post2015-07-20 10:59 +0100
Last post2015-07-20 10:59 +0100
Articles 1 — 1 participant

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


Contents

  Generating type annotations by tracing execution runs Michael Williamson <mike@zwobble.org> - 2015-07-20 10:59 +0100

#94226 — Generating type annotations by tracing execution runs

FromMichael Williamson <mike@zwobble.org>
Date2015-07-20 10:59 +0100
SubjectGenerating type annotations by tracing execution runs
Message-ID<mailman.779.1437388240.3674.python-list@python.org>
Hello,

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.)

At the moment, this is just a small prototype that I've cobbled
together. I was curious if anybody knows if anybody else has done
anything similar?

Thanks

Michael

[toc] | [standalone]


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


csiph-web