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


Groups > comp.lang.python > #16374

Re: python 2.5 and ast

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <d@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'happily': 0.07; 'terry': 0.07; 'versions.': 0.07; 'python': 0.08; 'scripts': 0.09; 'subject:python': 0.10; 'am,': 0.12; 'library': 0.13; 'ast': 0.16; 'received:192.168.1.104': 0.16; 'reedy': 0.16; 'cc:addr:python- list': 0.16; 'wrote:': 0.18; 'yet.': 0.18; 'cc:no real name:2**0': 0.20; 'later': 0.21; 'header:In-Reply-To:1': 0.22; 'code': 0.25; 'module': 0.26; "i'm": 0.26; 'code,': 0.27; 'cc:addr:gmail.com': 0.28; 'cc:addr:python.org': 0.29; 'pm,': 0.29; 'source': 0.31; 'version': 0.32; 'header:User-Agent:1': 0.33; 'that,': 0.33; 'there': 0.33; 'probably': 0.34; 'test': 0.35; 'cc:2**1': 0.36; 'but': 0.37; 'run': 0.37; 'received:192': 0.37; 'doing': 0.38; 'using': 0.38; 'easiest': 0.38; 'some': 0.38; 'put': 0.38; 'ways': 0.39; 'received:192.168': 0.40; 'tag': 0.64; 'header:Reply-To:1': 0.71; 'reply-to:no real name:2**0': 0.72; 'andrea': 0.84
Date Mon, 28 Nov 2011 22:55:49 -0500
From Dave Angel <d@davea.name>
User-Agent Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Thunderbird/3.1.15
MIME-Version 1.0
To Terry Reedy <tjreedy@udel.edu>
Subject Re: python 2.5 and ast
References <4ED37475.3050709@gmail.com> <jb0pnp$a7i$1@dough.gmane.org>
In-Reply-To <jb0pnp$a7i$1@dough.gmane.org>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:Ksw4Z3I9izz0MEy9inqi/or0DvwC+ALbsiS/tpXFJ8V XPTMe2e2acX8AU/pGxhLelChzdVJQ//Z8FQARwBOdiydz4b9JR RxQNo5+A7oWj3qaSRWjCes+18b8YdIB10dCXvfuNnNeRO2aPJK +yR126bSefzKw3FH8njJxfVSzb88YySwKoUa5dOKyp5/f5XWfJ amCCtLiPvEIxizDRsQtCf11Q4ihB0TCMyt/H4lh5ubOUQm0P3a +cePelM31sWrwv/TX9LztQNFOLFPdZHBah1ReiG6gKXByUxcwG cOkcj89mmCT2PFAf0m+hxntlYNkKi8UMJ9Um4HpCKAiktqVww= =
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
Reply-To d@davea.name
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3116.1322538979.27778.python-list@python.org> (permalink)
Lines 20
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1322538979 news.xs4all.nl 6916 [2001:888:2000:d::a6]:34874
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:16374

Show key headers only | View raw


On 11/28/2011 03:08 PM, Terry Reedy wrote:
> On 11/28/2011 6:45 AM, Andrea Crotti wrote:
>> I'm happily using the ast module to analyze some code,
>> but my scripts need also to run unfortunately on python 2.5
>>
>> The _ast was there already, but the ast helpers not yet.
>> Is it ok if I just copy over the source from the ast helpers in my code
>> base
>
> That is the standard way of backporting features of later versions.
>
But don't forget to tag it as version specific, so it gets removed when 
the later version of the library is available.  There are various ways 
of doing that, but the easiest is probably to put a test in the 
acceptance suite that fails if this code is used in 2.6 or later.

-- 

DaveA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: python 2.5 and ast Dave Angel <d@davea.name> - 2011-11-28 22:55 -0500

csiph-web