Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!weretis.net!feeder4.news.weretis.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:using': 0.04; 'does.': 0.07; 'transform': 0.07; 'python': 0.08; 'expressions.': 0.09; 'subject:python': 0.11; '16,': 0.15; 'aware,': 0.16; 'docstrings': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'syntactic': 0.16; 'wrote:': 0.16; 'header:In- Reply-To:1': 0.22; 'tue,': 0.23; 'pm,': 0.24; 'there.': 0.24; 'aug': 0.24; 'code': 0.25; 'paul': 0.28; 'loop': 0.28; 'message- id:@mail.gmail.com': 0.29; 'bare': 0.30; 'values': 0.32; 'to:addr :python-list': 0.33; 'idea': 0.34; 'similar': 0.35; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.39; 'to:addr:python.org': 0.39; 'subject:Idea': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=aQ/kW+KYIfZ7KD0oFe5/jXN+uuPl79j6BiL2NVWwgtc=; b=n2c0kc/E7HZVQr1HBbV4AszELjVj1zQ6kl1CR+J4NxRPj1Bt1SadSVGI7CFmo7T2N3 PBwlICr7yR2UU/n8VRbDSlU+o+SW3GSIbNSsWEFCa9xqcniS8WQB6507FB50jZSwhOoI t1C57YVsrtbrMhpjCcV1V898zGaU/BL1pBg2k= MIME-Version: 1.0 In-Reply-To: <2As2q.636$7r4.389@viwinnwfe02.internal.bigpond.com> References: <2As2q.636$7r4.389@viwinnwfe02.internal.bigpond.com> Date: Tue, 16 Aug 2011 17:14:24 +0100 Subject: Re: Idea for pure-python templates using AST. From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 9 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1313511267 news.xs4all.nl 23851 [2001:888:2000:d::a6]:57218 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:11575 On Tue, Aug 16, 2011 at 12:33 PM, Paul Wray wrote: > The idea is simply to use python ASTs to transform this code so that it > accumulates the values of the bare expressions. That'd be similar to what the interactive loop does. Are you aware, though, that docstrings are bare expressions? You may have a syntactic collision there. ChrisA