tags:

views:

639

answers:

6

Or should I just stick with Python2.5 for a bit longer?

+17  A: 

From python.org:

The current production versions are Python 2.6.2 and Python 3.0.1.

So, yes.

Python 3.x contains some backwards incompatible changes, so python.org also says:

start with Python 2.6 since more existing third party software is compatible with Python 2 than Python 3 right now

Dominic Rodger
+1: Quote the documentation. A link would have been even better.
S.Lott
@S.Lott Changed!
Dominic Rodger
+9  A: 

Ubuntu has switched to 2.6 in it's latest release, and has not had any significant problems. So I would say "yes, it's stable".

Lars Wirzenius
+6  A: 

It depends from libraries you use. For example there is no precompiled InformixDB package for 2.6 if you have to use Python on Windows.

Also web2py framework sticks with 2.5 because of some bug in 2.6.

Personally I use CPython 2.6 (workhorse) and 3.0 (experimental), and Jython 2.5 beta (for my test with JDBC and ODBC).

Michał Niklas
+4  A: 

Yes it it, but this is not the right question. The right question is "can I use Python 2.6, taking in consideration the incompatibilities it introduces ?". And the short answser is "most probably yes, unless you use a specific lib that wouldn't work with 2.6, which is pretty rare".

e-satis
what incompatibilities?
SilentGhost
E.G : the os.popen2 and os.popen3 implementationq in python 2.6expects the cmd argument to be a string. The documentation - help(os.popen3) - states that the cmd argument can be a sequence on Unix. There for it's incompatible with os.popen* in python 2.5
e-satis
I think you're misinterpreting the docs. http://www.python.org/doc/2.5.4/lib/os-newstreams.html#l2h-2628 says: "Also, for each of these variants, on Unix, cmd may be a sequence, in which case arguments will be passed directly to the program without shell intervention (as with os.spawnv()). If cmd is a string it will be passed to the shell (as with os.system()). "
SilentGhost
Well, I am not talking about what I've read in the doc. I just remember that there was known bugs causing incompatibilities between V2.5 and v2.6 and this is one of them. Don't have the link at hand but I'm sure you can still find it on the python bug tracker, I doubt it will be corrected before 2.7.
e-satis
Founf it :-) http://mail.python.org/pipermail/python-bugs-list/2009-February/071559.html.
e-satis
+1  A: 

I've found 2.6 to be fairly good with two exceptions:

  1. If you're using it on a server, I've had trouble in the past with some libraries which are used by elements of the server (Debian Etch IIRC). It's possible with a bit of jiggery pokery to maintain several versions of python in unison though if you're careful :-)
  2. This is no-longer true, but the last time I tried 2.6, wxPython had not been updated which meant all my gui tools I've written broke. There's now a version available that's built against 2.6.

So I'd suggest you check all the modules you use and check their compatibility with 2.6...

Jon Cage
A: 

I recently switched from python2.5 to 2.6 for my research project involving lots of 3rd party libs (scipy, pydot, etc.) and swig related stuff.

The only thing I had to change was to convert all strings with

s = unicode(s, "utf-8")

before I fed them into the logging module.

Otherwise, I got everytime

Traceback (most recent call last):
File "/usr/lib/python2.6/logging/__init__.py", line 773, in emit
stream.write(fs % msg.encode("UTF-8"))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 31: ordinal not in range(128)

wr