Path: csiph.com!usenet.pasdenom.info!news.albasani.net!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'package,': 0.03; 'fixes': 0.07; 'versions.': 0.07; 'enhancements': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:module': 0.09; 'python': 0.11; 'bug': 0.12; 'finney': 0.16; 'pypi.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; ':-)': 0.16; 'so.': 0.16; 'library': 0.18; 'obviously': 0.18; 'module': 0.19; 'separate': 0.22; 'header:User-Agent:1': 0.23; 'features,': 0.24; 'versions': 0.24; 'possibly': 0.26; 'least': 0.26; 'header:X-Complaints-To:1': 0.27; 'point': 0.28; "i'm": 0.30; 'code': 0.31; 'easier': 0.31; 'continues': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'writes:': 0.31; 'advice': 0.35; 'but': 0.35; 'vice': 0.36; 'doing': 0.36; 'useful': 0.36; 'url:org': 0.36; 'so,': 0.37; 'too': 0.37; 'two': 0.37; 'ben': 0.38; 'depends': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'back': 0.62; "you've": 0.63; 'more': 0.64; 'great': 0.65; 'skip:\xe2 10': 0.65; 'worth': 0.66; 'managing': 0.66; 'sam': 0.68; 'targeted': 0.69; 'wish': 0.70; 'special': 0.74; 'brain,': 0.84; 'it"': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ben Finney Subject: Re: Maintaining a backported module Date: Thu, 24 Oct 2013 16:09:55 +1100 References: <5268a818$0$30000$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: rasputin.madmonks.org X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-gpg.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:FZqxnWpjLFwouOc0bPDo551aTf4= 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: 1382591409 news.xs4all.nl 15948 [2001:888:2000:d::a6]:44724 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:57409 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. > > I'm looking for advice on best practices for doing so. Any suggestions > for managing bug fixes and enhancements to two separate code-bases > without them diverging too much? It is a great advantage that you've targeted Python 3 primarily. As I understand it, it is far easier to make an existing Python 3 code base also work on Python 2, than vice versa. (Though that will obviously change as Python 3 continues to diverge from Python 2. The more one depends on Python 3 features, the more one depends on back-ported versions of those features for Python 2. I'm pretty sure that's not going to be much of an issue for the ‘statistics’ package, but it's worth mentioning as a general caveat.) > Other than "Avoid it" :-) A useful library for this purpose is ‘six’ (as in “3 × 2”) . You can use its features to do things that are useful or better in Python 3, but which need special implementation to work on Python 2; and the same code will just work on both versions. -- \ “Pinky, are you pondering what I'm pondering?” “I think so, | `\ Brain, but if we get Sam Spade, we'll never have any puppies.” | _o__) —_Pinky and The Brain_ | Ben Finney