Backwards Compatibility of Python versions

Paul Rubin phr-n2002a at nightsong.com
Mon Feb 4 17:46:01 EST 2002


Manoj Plakal <terabaap at yumpee.org> writes:
>           So if you're distributing Python code, it looks
>           like you have some choices:
>               - Require use of Python <= 2.1, no matter
>                 what the latest and greatest version of
>                 Python provides (perhaps bundle the interpreter
>                 with your software if people don't want to keep
>                 an extra copy of Python to run your stuff)

That bogus in most circumstances (though not always).  Python is
supposed to let me write small, self-contained programs that do
amazing things.  If I have to ship a huge interpreter along with my
scripts, they're no longer small.  If I make people find and download
some old Python version, they're no longer self contained.  So the
scripts should run on whatever Python versions most users have
installed.

>               - Require Python <= 2.1 now, but eventually
>                 migrate your users to 2.2 or 3.0 by releasing
>                 newer versions of your software

Won't work--I don't control what the users do.  I might issue new
releases but users will keep running the old ones, just like Python 2.2
has been released but most users are using older versions.

>               - Require Python >= 2.2 now, and hopefully
>                 use the from future mechanism to avoid
>                 the above headaches.

No good either.  I'd have to tell 90% of current Python users to go
upgrade their Python installation and I'd consider that incredibly
obnoxious.  Think of how angry you've gotten if you've looked at a web
page and seen "you must upgrade your browser to MSIE 6.9 (or whatever)
and reboot your system in order to view this page.  Click here to
start the 35 megabyte download".  Why couldn't they have just stuck
with standard HTML so the page would work your regular browser?

>           Also, I'm curious, why does your code depend
>           so critically on integer division? 

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.



More information about the Python-list mailing list