views:

108

answers:

2

Is there an officially updated recommendation indicating which versions of Python should be supported by released modules? Or perhaps a page giving a survey of production usage of various versions? It's difficult to know how much use to make of newish features like context managers, class decorators, etc. when writing a module.

Note that learning which versions of Python are in common usage now is only part of my question; I'd like to find a resource which will provide up-to-date information for future readers of this thread (and myself).

+6  A: 

I'm not aware of any single resource keeping an up-to-date summary of production usage of different Python versions, but a good start would probably be to check which Python versions that are distributed with various Linux distributions. Here's a sample for some of the most used server distributions (taken from Distrowatch):

Debian

  • Debian 5.0 (2009-02-15): Python 2.5.2
  • Debian 4.0 (2007-04-08): Python 2.4.4
  • Debian 3.1 (2005-06-06): Python 2.3.5

Ubuntu

  • Ubuntu 10.04 LTS (2010-04-29): Python 2.6.5
  • Ubuntu 8.04 LTS (2008-04-24): Python 2.5.2

Red Hat Enterprise Linux

  • RHEL 5.5 (2010-03-30): Python 2.4.3
  • RHEL 4.8 (2009-05-19): Python 2.3.4
  • RHEL 3.9 (2007-05-30): Python 2.2.3

Clearly, Red Hat is the limiting factor here. The latest stable RHEL release ships with Python 2.4, and as there's a fair number of RHEL servers out there, you'll have to target Python 2.4 unless you want Red Hat users to install a newer Python version from source or from third-party RPMs. If you don't mind leaving RHEL behind you could probably go for 2.5 or 2.6 instead.

Pär Wieslander
+1: And in some RHEL distributions, building Python 2.7 from source is a pain because it has a lot of dependencies.
S.Lott
Helpful, thanks. Is there a way to generate such a data view using distrowatch or another site, or did you compile this by hand? I'm hoping for a convenient way to get an updated list in, say, a year's time. ——————————— I also noticed that the date for RHEL 4.8 was typoed: the year should be 2009.
intuited
I looked it up manually at distrowatch. It took only a few minutes, which I consider convenient enough since you probably only would have to check it perhaps every year or so. Thanks for noticing the typo; it's fixed now.
Pär Wieslander
A: 

Mac OS X 10.6 (Snow Leopard) has 2.6.1 as the installed version.

IIRC, 10.5 (Leopard) has 2.5 as the installed version.

Matthew Schinckel