Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #57445
| Date | 2013-10-24 06:36 -0400 |
|---|---|
| From | Ned Batchelder <ned@nedbatchelder.com> |
| Subject | Re: Maintaining a backported module |
| References | <5268a818$0$30000$c3e8da3$5496439d@news.astraweb.com> <7wtxg7cfww.fsf@benfinney.id.au> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1463.1382611399.18130.python-list@python.org> (permalink) |
On 10/24/13 2:59 AM, Ben Finney wrote: > Steven D'Aprano <steve@pearwood.info> 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 > <URL:http://nedbatchelder.com/blog/200910/running_the_same_code_on_python_2x_and_3x.html>. 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 > <URL:http://eli.thegreenplace.net/2010/05/19/making-code-compatible-with-python-2-and-3/>. >
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Maintaining a backported module Steven D'Aprano <steve@pearwood.info> - 2013-10-24 04:54 +0000
Re: Maintaining a backported module Ben Finney <ben+python@benfinney.id.au> - 2013-10-24 16:09 +1100
Re: Maintaining a backported module Metallicow <metaliobovinus@gmail.com> - 2013-10-23 22:46 -0700
Re: Maintaining a backported module Metallicow <metaliobovinus@gmail.com> - 2013-10-30 03:32 -0700
Re: Maintaining a backported module Paul Rubin <no.email@nospam.invalid> - 2013-10-23 22:38 -0700
Re: Maintaining a backported module Ethan Furman <ethan@stoneleaf.us> - 2013-10-23 23:30 -0700
Re: Maintaining a backported module Ben Finney <ben+python@benfinney.id.au> - 2013-10-24 17:59 +1100
Re: Maintaining a backported module Steven D'Aprano <steve@pearwood.info> - 2013-10-24 09:38 +0000
Re: Maintaining a backported module Ben Finney <ben+python@benfinney.id.au> - 2013-10-24 21:01 +1100
Re: Maintaining a backported module Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-10-24 09:00 +0200
Re: Maintaining a backported module Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-24 09:37 +0100
Re: Maintaining a backported module Ned Batchelder <ned@nedbatchelder.com> - 2013-10-24 06:36 -0400
Re: Maintaining a backported module Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-24 11:46 +0000
Re: Maintaining a backported module rusi <rustompmody@gmail.com> - 2013-10-24 05:25 -0700
Re: Maintaining a backported module Ned Batchelder <ned@nedbatchelder.com> - 2013-10-24 13:46 -0400
Re: Maintaining a backported module Terry Reedy <tjreedy@udel.edu> - 2013-10-24 16:37 -0400
Python Coverage: testing a program (was: Maintaining a backported module) Ben Finney <ben+python@benfinney.id.au> - 2013-10-25 07:54 +1100
Re: Python Coverage: testing a program Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-24 22:55 +0100
Re: Python Coverage: testing a program Terry Reedy <tjreedy@udel.edu> - 2013-10-24 18:36 -0400
Re: Python Coverage: testing a program Ethan Furman <ethan@stoneleaf.us> - 2013-10-24 15:28 -0700
Re: Python Coverage: testing a program Ben Finney <ben+python@benfinney.id.au> - 2013-10-25 10:27 +1100
Re: Python Coverage: testing a program Ben Finney <ben+python@benfinney.id.au> - 2013-10-25 10:30 +1100
Re: Python Coverage: testing a program Ned Batchelder <ned@nedbatchelder.com> - 2013-10-24 19:53 -0400
Re: Python Coverage: testing a program Terry Reedy <tjreedy@udel.edu> - 2013-10-24 19:55 -0400
Re: Maintaining a backported module Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-10-25 08:49 +0100
Re: Maintaining a backported module Christian Heimes <christian@python.org> - 2013-10-24 12:47 +0200
Re: Maintaining a backported module Ethan Furman <ethan@stoneleaf.us> - 2013-10-24 12:42 -0700
csiph-web