Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.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; 'resulting': 0.04; 'base.': 0.05; 'plenty': 0.07; 'versions.': 0.07; '2.3,': 0.09; 'adopted': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; "wouldn't": 0.14; 'benefit.': 0.16; 'delicate': 0.16; 'maintainer': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'module': 0.19; 'header:User-Agent:1': 0.23; "aren't": 0.24; 'frameworks': 0.24; 'decide': 0.24; 'fine': 0.24; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'leave': 0.29; 'wonder': 0.29; '2.3': 0.30; 'work.': 0.31; 'code': 0.31; 'accidentally': 0.31; 'behind.': 0.31; 'layer': 0.31; 'there.': 0.32; 'this.': 0.32; 'advice': 0.35; 'case,': 0.35; 'but': 0.35; 'version': 0.36; 'effort': 0.37; 'tools,': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'little': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'easy': 0.60; 'then,': 0.60; 'break': 0.61; 'more': 0.64; 'great': 0.65; 'worth': 0.66; 'latest': 0.67; 'six': 0.68; 'eyes': 0.78; 'yourself': 0.78; 'glad': 0.83; 'batchelder': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ned Batchelder Subject: Re: running python 2 vs 3 Date: Thu, 20 Mar 2014 16:53:25 -0400 References: <87ob10nbeh.fsf@elektro.pacujo.net> <532B4750.2090006@yahoo.com> <87eh1wpr96.fsf@elektro.pacujo.net> <8738icppoe.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 18.189.9.83 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 In-Reply-To: <8738icppoe.fsf@elektro.pacujo.net> 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: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1395348816 news.xs4all.nl 2836 [2001:888:2000:d::a6]:37723 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:68620 On 3/20/14 4:42 PM, Marko Rauhamaa wrote: > Ned Batchelder : > >> Plenty of people have adopted a dual-support strategy, with one code >> base that supports both Python 2 and Python 3. The six module can help >> a great deal with this. > > I wonder how easy the resulting code is to the eyes and how easy it is > for the casual maintainer to accidentally break the delicate balance. In > a word, I wouldn't go there. Stay with Python2 as long as you must and > then, migrate and leave it behind. This is fine advice for applications, but tools, libraries, and frameworks may want to support more than one version at the same time. It's an extreme case, but the latest released version of coverage.py supports Python 2.3 through 3.3 with one code base. To do it, there's a compatibility layer (akin to six). Then you stay away from features that aren't available on all versions. In a few places, you might need to have version checks, and the code can get a little idiomatic to continue to work. It's a tradeoff: you have to decide for yourself whether the effort is worth the benefit. I was glad to be able to drop support for 2.3, 2.4, and 2.5, and now only support 2.6-3.4 in coverage.py. > > > Marko > -- Ned Batchelder, http://nedbatchelder.com