Backwards Compatibility of Python versions

Jonathan Hogg jonathan at onegoodidea.com
Mon Feb 4 18:51:29 EST 2002


On 4/2/2002 22:46, in article 7x4rkwdfx2.fsf at ruckus.brouhaha.com, "Paul
Rubin" <phr-n2002a at nightsong.com> wrote:

> The program I'm hacking right now actually needs exact rational
> division, but that's another story.  The issue is there's no way to
> use integer division that works in both 2.1 and 3.0, without using
> something like divmod that would shock the unwary.

I'm sorry, the "unwary"? I presume by this you mean that your user base
contributes to your code, that you aren't the only programmer on the
project? Are the other coders having difficulty with reading or writing
1.5.2 forward compatible code?

The Arusha codebase (the largest Python project I'm involved in), runs to
10000 lines of Python - all of which operates fine [unknown bugs
notwithstanding ;-)] in 1.5.2 to 2.2 (though I had to hack some external
code that used the long-deprecated regex module).

> I bet less than 10% of users have 2.2 right now.  I'm curious about
> the ratio of 2.1 users to 1.5.2 users.  Do you have any idea what it
> is?  I don't know how I'd measure it.  There's no User-agent header
> collected at python.org every time someone runs a Python script.

The easy way for you to tell is to make two versions of your code available,
one written for 1.5.2 and one optimised for 2.1 upwards (where they may be
exactly the same version - I'm not suggesting you do any more work). You'll
be able to gauge from downloads/sales/however your users obtain your work,
which version they have.

At the moment, this honestly looks like a storm in a teacup to me. I'm sure
you can put a small disclaimer on your program saying "I cannot guarantee
this program will work in some unknown future time on an as yet unknown
version of the Python interpreter."

Jonathan




More information about the Python-list mailing list