Python version(s) for new project?

andrew cooke andrew at
Thu Mar 26 15:34:46 CET 2009

Philip Semanchuk wrote:
> Hi all,
> I'm about to start a new job at which I and others will build a
> project largely in Python. I'm trying to figure out which Python
> versions to use and support. I can't use Python 3.x, but I want to
> prepare for it even if it is a long way off yet.
> My idea is to use Python 2.6 on my development box and 2.4/2.5 on the
> test machines. This would allow me to use the -3 switch on my machine
> so that I keep the code relatively free of features unsupported or
> deprecated in 3.x. It will also ensure that I write code backwards
> compatible with older Python versions.
> Does this sound sane?

i don't know the details of your constraints (what libs require 2.5 rather
than 2.6, for example).  what you say makes sense only if you need to be
compatible with 2.4/2.5.  if so, you'll find it quite tricky to produce
code that is compatible across all versions - you will effectively end up
using the subset of python that is common across 2.4 to 3.

if you can, going with 2.6/3 alone will make your life much easier,
because that means you can use 3.0 almost directly, but still run on the
"standard" 2.6 release.  but it may conflict with your requirements.

note - my experience is with taking 3.0 code and trying to make it run on
2.6 (easy) and 2.5 (hard).  i guess it is possible things are easier if
you start out with all 3 in mind.


> My constraints:
> - Need to support Linux and Windows
> - I'll be developing under OS X (thank you VirtualBox!)
> - Using wxPython, scipy, numpy, SWIG
> - Code will eventually be open sourced
> Thanks
> Philip
> --

More information about the Python-list mailing list