views:

1057

answers:

5

If I was going to start an open source project using Python what version should I use to ensure that the vast majority of users can use it on their system?

I'm the kind of person who quickly jumps to the next version (which I'll do when Python 3 comes out) but many people may be more conservative if their current version seems to be working fine. What version would hit the sweet spot but still allow me to enjoy the newest and coolest language enhancements?

+4  A: 

I've not seen a system with less than 2.3 installed for some time. Mostly 2.4+ is installed by default for most OS I use now. 2.3 is just on an older Solaris machine. Linux distros tend to have 2.4+, as does OS X.

IIRC, 2.4 has a lot of the features 2.5 does, but usable only with

from __future__ import *
Matthew Schinckel
+6  A: 

As python is in kind of an transition phase towards python 3 with breaking backward compatibility I don't think it is a good idea to go python 3 only. Based on the time line there will be at least one or two following releases of the 2.x series after 2.6/3.0 in october.

Beside not having python 3 available on your target platforms, it will take some time until important external python libraries will be ported and usable on python 3.

So as Matthew suggests staying at 2.4/2.5 and keeping the transition plan to python 3 in mind is a solid choice.

Peter Hoffmann
It's interesting to me that as of July 2010, the same thing is basically true, and that nothing has changed. Maybe the 2.7 release would be the new advice.
Warren P
+1  A: 

You can use different versions of python on each machine.

Coding something new, I would not use anything less than python2.5. You can do apt-get install python2.5 on stock debian stable.

For windows, don't really worry about it. It's very easy to install the python2.5 msi.

If the users can't be bothered to do that, you can deploy an executable with py2exe (so simple) and build an installer with inno setup (again simple) then it will behave like a standard windows application and will use its own python dlls, so no need to have python installed.

Like Peter said: keep in mind the transition to 3.0 but don't build on it yet.

Christopher Mahan
+1  A: 

Python 2.3, or 2.2 if you can live without the many modules that were added (e.g. datetime, csv, logging, optparse, zipimport), aren't using SSL, and are willing to add boilerplate for True/False.

2.4 added decorators. generator expressions, reversed(), sorted(), and the subprocess and decimal modules. Although these are all nice, it's easy to write Pythonic code without them (assuming that your project wouldn't make heavy use of them).

2.5 added with, relative imports, better 64 bit support, and quite a bit of speed. You could live without all of those easily enough.

2.6 isn't released (although it's very close), so while it might appeal to developers, it doesn't have the compatibility you're after.

Take a look at the release notes for 2.3, 2.4, 2.5, and the upcoming 2.6 (use http://www.python.org/download/releases/2.Y/highlights/ where 'Y' is the minor version).

FWIW, for SpamBayes we support 2.2 and above (2.2 requires installing the email package separately). This isn't overly taxing, but the 2.3 additions are useful enough and 2.3 old enough that we'll probably drop 2.2 before long.

Tony Meyer
A: 

If the project is going to be mainstream and will be run on Linux the only sensible choise is 2.4 - just because it is a pain to get anything else installed as default on Enterprise Linuxes.

In any case, any modern OS will/can have 2.4 or newer.

Kimvais