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


Groups > comp.lang.python > #57469

Re: Maintaining a backported module

Path csiph.com!usenet.pasdenom.info!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 <ethan@stoneleaf.us>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; '*not*': 0.07; 'class,': 0.07; 'fixes': 0.07; 'enhancements': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'lawrence': 0.09; 'message-id:@stoneleaf.us': 0.09; 'subject:module': 0.09; '~ethan~': 0.09; 'bug': 0.12; '2.7': 0.14; 'thread': 0.14; 'posted': 0.15; 'dictionary,': 0.16; 'enum': 0.16; 'intersection': 0.16; 'received:69.93': 0.16; 'targeting': 0.16; 'so.': 0.16; 'thanks,': 0.17; 'wrote:': 0.18; 'written': 0.21; '>>>': 0.22; 'example': 0.22; 'separate': 0.22; 'header:User- Agent:1': 0.23; 'class.': 0.26; 'define': 0.26; 'header:In-Reply- To:1': 0.27; 'am,': 0.29; "i'm": 0.30; 'code': 0.31; '3.x': 0.31; 'bunch': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'class': 0.32; 'probably': 0.32; 'running': 0.33; 'could': 0.34; 'advice': 0.35; 'add': 0.35; 'doing': 0.36; 'charset:us-ascii': 0.36; 'example,': 0.37; 'too': 0.37; 'two': 0.37; 'easiest': 0.38; 'mine': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'anything': 0.39; 'structure': 0.39; 'to:addr:python.org': 0.39; 'read': 0.60; 'managing': 0.66; 'experience.': 0.67; '2.5.': 0.84; 'ethan': 0.84; 'experiences,': 0.84; 'furman': 0.84; 'received:gateway15.websitewelcome.com': 0.84; 'us?': 0.84
Date Thu, 24 Oct 2013 12:42:33 -0700
From Ethan Furman <ethan@stoneleaf.us>
User-Agent Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121010 Thunderbird/16.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> <5268BE79.9010908@stoneleaf.us> <l4am7s$v01$3@ger.gmane.org>
In-Reply-To <l4am7s$v01$3@ger.gmane.org>
Content-Type text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding 7bit
X-AntiAbuse This header was added to track abuse, please include it with any abuse report
X-AntiAbuse Primary Hostname - gator3304.hostgator.com
X-AntiAbuse Original Domain - python.org
X-AntiAbuse Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse Sender Address Domain - stoneleaf.us
X-BWhitelist no
X-Source
X-Source-Args
X-Source-Dir
X-Source-Sender ([192.168.5.100]) [64.134.136.14]:48752
X-Source-Auth ethan+stoneleaf.us
X-Email-Count 2
X-Source-Cap dG9idWs7dG9idWs7Z2F0b3IzMzA0Lmhvc3RnYXRvci5jb20=
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1479.1382647914.18130.python-list@python.org> (permalink)
Lines 31
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1382647914 news.xs4all.nl 15964 [2001:888:2000:d::a6]:47169
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:57469

Show key headers only | 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