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


Groups > comp.lang.python > #57469

Re: Maintaining a backported module

Date 2013-10-24 12:42 -0700
From Ethan Furman <ethan@stoneleaf.us>
Subject Re: Maintaining a backported module
References <5268a818$0$30000$c3e8da3$5496439d@news.astraweb.com> <5268BE79.9010908@stoneleaf.us> <l4am7s$v01$3@ger.gmane.org>
Newsgroups comp.lang.python
Message-ID <mailman.1479.1382647914.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 10/24/2013 01:37 AM, Mark Lawrence wrote:
> On 24/10/2013 07:30, Ethan Furman wrote:
>> On 10/23/2013 09:54 PM, Steven D'Aprano wrote:
>>>
>>> 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?
>>
>> Confining your code to the intersection of 2.7 and 3.x is probably going
>> to be the easiest thing to do as 2.7 has a bunch of 3.x features.
>>
>> Sadly, when I backported Enum I was targeting 2.5 - 3.x because I have
>> systems still running 2.5.  That was *not* a fun experience.  :(
>>
>> --
>> ~Ethan~
>
> Have you or could you publish anything regarding your experiences, I
> suspect it would be an enlightening read for a lot of us?

The only thing I can add to what's already been posted in this thread 
(and it was advice I got from Barry -- Thanks, Barry! :) is when your 
class structure cannot be written the same in both 2 and 3 (because, for 
example, you are using metaclasses) then you have to define your 
methods outside of a class, store them in a dictionary, and then use 
type to create the class.  You can look at Enum for an example (his or 
mine ;).

--
~Ethan~

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


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