Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'finished,': 0.07; 'cc:addr :python-list': 0.09; 'added.': 0.09; 'annotations': 0.09; 'runs,': 0.09; 'url:github': 0.09; 'python': 0.10; 'appropriate': 0.14; 'codebases.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'readme.rst': 0.16; 'stored.': 0.16; 'subject:type': 0.16; 'wrote:': 0.16; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'arguments': 0.22; 'code,': 0.23; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; "i've": 0.25; 'example': 0.26; 'message-id:@mail.gmail.com': 0.27; 'values': 0.28; 'allows': 0.30; 'code': 0.30; 'source': 0.33; 'michael': 0.33; '(for': 0.34; 'running': 0.34; 'received:google.com': 0.35; 'pm,': 0.36; 'subject:: ': 0.37; 'things': 0.38; 'test': 0.39; 'system.': 0.39; 'some': 0.40; '20,': 0.66; 'jul': 0.72; 'sounds': 0.76; 'chrisa': 0.84; 'to:none': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=z9pXzuchjvvISf20UcCkQBzBSScIQqAQ+PlpDOMDrrQ=; b=Gx7WOkvQ/w1c17sm5+K0vGaaHGIjkndu1o0uscSNVBslOpcrOIrZvaRriWutOdc8y4 Jicb4jAjpXwLvbZNk3hTgP+67KhBiD5tNSHvq8nOFZ74MXNrGXjHRvo4EPQvL1aOXg7+ CO8MgdnqsnqXRC6q7e/2ETy5rr3/YeKTeCIC8bKBiAv44Jg5a9NwrrhKUNlnIB+dGp5t 6mNWu/DyLWHWvHZe6BLXSdkK3pSrr4Da+ycubh1uMwSyYYbyCbcsUqFcP/pMhExafr0a z6z5/tDLMoat0SJEv9xXnpDb9fxc2genDH4IuCblSSx1QwoTqyg1xqHHky3SNVRsZyV7 g3KQ== MIME-Version: 1.0 X-Received: by 10.107.132.7 with SMTP id g7mr38314288iod.9.1437412681209; Mon, 20 Jul 2015 10:18:01 -0700 (PDT) In-Reply-To: <20150720105928.1a84afa8@mwilliamson.workgroup> References: <20150720105928.1a84afa8@mwilliamson.workgroup> Date: Tue, 21 Jul 2015 03:18:01 +1000 Subject: Re: Generating type annotations by tracing execution runs From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1437412683 news.xs4all.nl 2878 [2001:888:2000:d::a6]:54297 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:94240 On Mon, Jul 20, 2015 at 7:59 PM, Michael Williamson 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