views:

228

answers:

2

We think about whether we should convert a quite large python web application to Python 3 in the near future.
All experiences, possible challenges or guidelines are highly appreciated.

+12  A: 

My suggestion is that you stick with Python 2.6+, but simply add the -3 flag to warn you about incompatibilities with Python 3.0. Then you can make sure your Python 2.6 can be easily upgraded to Python 3.0 via 2to3, without actually making that jump quite yet. I would suggest you hold back at the moment, because you may at some point want to use a library and find out that it is only available for 2.6 and not 3.0; if you make sure to cleanup things flagged by -3, then you will be easily able to make the jump, but you will also be able to take advantage of the code that is only available for 2.6+ and which is not yet ready for 3.0.

Michael Aaron Safyan
+1, and move to 2.7 when it gets out of beta - yet another step closer to 3.1
Tim Pietzcker
+4  A: 

For each third-party library that you use, make sure it has Python 3 support. A lot of the major Python libraries are migrated to 3 now. Check the docs and mailing lists for the libraries.

When all the libraries you depend on are supported, I suggest you go for it.

codeape
I didn't think a lot of the major Python libraries are migrated yet. Which ones are you thinking of?
Craig McQueen
A couple of examples: sqlalchemy, jinja2, werkzeug
codeape
But I guess it depends on your def. of "major"... Those three are important to me when I create web apps. So they're "major" to me, at least.
codeape