views:

660

answers:

8

When will be Python 3.x ready for serious production? I'm thinking mainly in web apps. I have been programming with the 3.x using only the "batteries included" and all works just fine, but I am forced to go back to 2.x when I have to make any serious work in the web (eg, django and/or google app engine). I am primarily interested in these, but my question is more general... when will I be able to discard 2.x for new projects?

Should I wait months?, years?, how many?

Is the transition going well, or are the "big guys" neglecting this new version?

Thanks to all.

+1  A: 

How about now?

It really depends how interested you are in either:

  1. creating your own mini-framework on top of WSGI, or
  2. spending some time or money to upgrade the framework of your choice

We opted for #1, taking proven methodologies (and code in some cases) from other frameworks like werkzerg, and building it on Apache + mod_wsgi + Python 3.1.1.

Adventures in compiling Python 3.1.1 and mod_wsgi:
http://stackoverflow.com/questions/1547310/python-3-1-1-with-enable-shared-will-not-build-any-extensions

Performance testing of mod_wsgi on RHEL+apache
http://blog.gahooa.com/2009/10/11/python-3-1-and-mod_wsgi-performance-notes/

mod_wsgi
http://code.google.com/p/modwsgi/

That being said, it's not exactly "plug and play" just yet, but completely doable. Hey, someone's got to take the initiative to break the sod and make it easy for others to follow.

Good luck!

gahooa
Further to mod_wsgi readiness, see 'http://blog.dscpl.com.au/2009/10/new-release-candidate-for-modwsgi-30-is.html'.
Graham Dumpleton
+6  A: 

This is really asking when all the libraries/systems you need for your development are going to be ported to 3.x

You'll need to look at each and every one of those and see what their timelines are. Some of them may have even stated they won't be supporting 3.x. Then you'll need to look for alternatives, so the port yourself or write your own.

Most developers are probably waiting for 3.x to reach critical mass.

There may also be differences in performance to consider

GAE has an issue about it

gnibbler
Python 3.1 has closed much of the performance gap between 3.x and 2.x.
Kalmi
Thank you for the GAE tip.
cpicada
+13  A: 

Python 3.1 is perfectly ready, in and of itself -- it's a solid, reliable, production-ready release of the Python language and standard library.

Depending on what third-party extensions, frameworks or tools you need, if any, you may be able to switch to it today -- or, it may be years from now: it's obviously impossible for any Stack Overflow responder to tell you!-)

That impossibility is because, after all, you are the only one who can answer the key question, "what such 3rd party offerings are necessary to you" -- and the suppliers of those various offerings are the only ones who can (if you ask them, and if they're willing to answer your questions;-) tell you what their plans (if any) are about releasing 3.* compatible versions of said products and services.

Alex Martelli
+1 to Alex (again). It's up to all of us to persuade package maintainers to support Python 3.x. It's really not much work to port most things from 2.x to 3.x but many maintainers will not bother unless they feel the demand.
Salim Fadhley
@Alex, Is there anything you can tell us about your (or your company's or other companies') plans to move to 3.*?
foosion
@foosion, alas, I don't know, and if I did know I'd have to be quiet about it!-)
Alex Martelli
@Alex, that why I asked if there was anything you can tell us (v. what you knew) :D thanks
foosion
@AlexAs it can be seen in my question, I am primarily focused in Django and the Google App Engine. I get your point of asking about the port to the people working in those projects.
cpicada
Alex Martelli
+3  A: 

The main library that has been missing for Python 3 and has stopped a lot of libraries from supporting it has been setuptools. However, there now is Python 3 support through the Distribute project. I hope this will mean that we see a lot of libraries starting to support Python 3 during this year. When it becomes "ready" depends on when the libraries you need are ready. How fast adoption will be is impossible to say.

Since you marked your answer with Django, though, the answer does get simpler. It will be ready for Django, once Django is ported.

Lennart Regebro
+1 Distribute is awesome!
Salim Fadhley
+1  A: 

I guess it will take at least 2 or 3 years (maybe more) for python 3 to become mainstream. There is a lot of code for python 2.x, 2.x branch is well maintained and python 3.x doesn't provide super-features compared to 2.x. Porting code to python 3 requires some work and 'big guys' are pragmatic and won't port their code to python 3 without clear advantages just because it is the new language version.

Mike Korobov
I believe that the critical point about the speed to move to 3.x is the lack of "super-features", as you put. 3.x is cleaner and more coherent, but it doesn't bring anything spectacular that invites people to make a port.
cpicada
Maybe the Unicode improvements aren't seen as significant by English speakers, but for the rest of the world, they're a great improvement.
Craig McQueen
A: 

The main library that has been missing for Python 3 and has stopped a lot of libraries from supporting it has been setuptools. However, there now is Python 3 support through the Distribute project

Now that Distribute is gaining momentum, we should hopefully see more porting from large projects like Numpy/Scipy, PIL, etc. Those packages alone are the biggest ties to 2.x we're experiencing where I work.

Rayjan
+1  A: 

Library support is the main issue, for now, until library developers develop their support for Python 3.x.

For example, here are some popular libraries that you might be interested in using, that do not yet support Python 3.x:

Here are some libraries that do support Python 3.x:

Libraries with support in-progress:

Craig McQueen
A: 

I was wondering the same thing as the OP. I'd love to start new projects in Python 3000, but I don't want to back myself into a corner. So I remain on Python 2.7

I suppose when every library I use is available for Python 3, that will be the time I move over. It's not there yet.

ראובן