Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'ambitious': 0.04; 'syntax': 0.04; 'subject:module': 0.09; 'runs': 0.10; 'url:blog': 0.10; 'python': 0.11; 'mostly': 0.14; 'finney': 0.16; 'pypi.': 0.16; 'stuff.': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'module': 0.19; 'header:User-Agent:1': 0.23; 'rid': 0.24; 'helpful': 0.24; 'versions': 0.24; "i've": 0.25; 'possibly': 0.26; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'am,': 0.29; '2.3': 0.30; 'newer': 0.30; "i'm": 0.30; "d'aprano": 0.31; 'layer': 0.31; 'steven': 0.31; 'url:05': 0.31; 'writes:': 0.31; 'run': 0.32; 'advice': 0.35; 'something': 0.35; 'test': 0.35; 'received:google.com': 0.35; 'should': 0.36; 'ben': 0.38; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'called': 0.40; 'back': 0.62; 'six': 0.68; 'limit': 0.70; 'wish': 0.70; 'article': 0.77; 'batchelder': 0.84; 'bendersky': 0.84; 'eli': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=/9m+6vk7MvrdxGAFvxfI1B1z22T1vX+lw9NMb8WHc24=; b=awS+69fHSq3qVQFD35ARm1CPOT6qU9NVZKqvKFTU3jPT+5N2e5U1m0R/hmBmpoo2HM zprC1rxV2a/le4KQJr9jjF+IHDXEmos9h1FLa2B2rlZVCUPchLCZmmSvP9VyURx1jNvB eY5VnYYYrwKhluF91FwNQbBw6IUJH8O53w/1pxHrOCZ4/EkyRyPZ63ESp53SIdwZUQUA YR6P0CVDfLbUQbhcVLkDQVbs8khZTwshyq2VFqDy7k7QMPTRnec3Pu+qVxwbyl0D11sl WHBK6hslqykQ2DnmILk3U9qE9PlsgiR+CtsxOeiS9aWRpHXR+rkosq95a17+AS6gD/Yc +rkg== X-Received: by 10.220.1.203 with SMTP id 11mr1044952vcg.15.1382610965157; Thu, 24 Oct 2013 03:36:05 -0700 (PDT) Sender: Ned Batchelder Date: Thu, 24 Oct 2013 06:36:04 -0400 From: Ned Batchelder User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Maintaining a backported module References: <5268a818$0$30000$c3e8da3$5496439d@news.astraweb.com> <7wtxg7cfww.fsf@benfinney.id.au> In-Reply-To: <7wtxg7cfww.fsf@benfinney.id.au> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1382611399 news.xs4all.nl 15906 [2001:888:2000:d::a6]:57683 X-Complaints-To: abuse@xs4all.nl Path: csiph.com!usenet.pasdenom.info!news.franciliens.net!feed.ac-versailles.fr!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Xref: csiph.com comp.lang.python:57445 On 10/24/13 2:59 AM, Ben Finney wrote: > Steven D'Aprano writes: > >> I'm now at the point where I wish to backport this module to support >> versions of Python back to 3.1 at least and possibly 2.7, and put it >> up on PyPI. > Ned Batchelder has managed something at least as ambitious (supporting > Python versions 2.4 through 3.3), which should be helpful in your case > . FWIW, coverage.py currently runs on 2.3 through 3.4. It mostly comes down to: 1. avoiding newer features (decorators! generator expressions! rpartition!), 2. using a compatibility layer like "six" (though I started my own called backward.py before six existed), 3. using some awkward syntax workarounds (sys.exc_info()[1] to get the current exception), 4. somehow finding a way to test on all those versions (pythonz helps, and you have to limit your dependencies). Also, I've just started the coverage.py 4.x branch, which will run on >=2.6 and >=3.2, and it's very nice to get rid of some of that compatibility stuff. --Ned. > Eli Bendersky also has an article with specific advice > . >