>Django 1.5 is the first Django release with support for Python 3 (specifically, Python 3.2 and newer).
That sentence is of course followed by caveats about Python 3 support being experimental at this stage, but all-in-all I think this is a sign that we are finally at the tipping point for Python 3 to start gaining mainstream usage.
Thank you Django community for moving the ball forward for everyone.
FYI, the "experimental" thing is a community thing, not really a technical judgement. Since this is our first Python 3 release, we want to have some space to make changes between 1.5 and 1.6 that we otherwise would avoid because of our strong backwards compatibility promise. The "experimental" label is about giving ourselves that room and not surprising users if there do have to be changes in the way Py3 support works between 1.5 and 1.6.
Technically, however, it's pretty rock-solid. I'll be launching a site built on Py3/1.5 is about two weeks, and aside from constantly forgetting to `print(...)` instead of `print ...` it's been surprisingly smooth sailing.
Have you found any of the third-party Django extensions to be catching up? I'm starting a new project and would love to just start with Python3, but there are a few packages I depend on: South, lxml, pytz, simplejson, requests, django-compressor, gunicorn, jinja2, twisted, txAMQP, and django-rest-framework (amongst some other utilities actually used for development).
It would sure be great to have a list of django sub-projects and their Python3 status.
Regardless, even if we start with Python2.7 and bump up to 3.3 in a few months, this is a great step!
* txAMQP probably can't get ported until twisted does.
* django-rest-framework has Python 3 support, I think it's fairly recent, but it works well.
This list is about typical of what I've found doing Django/Py3 work: many things are ported, a bunch more have good alternatives, and a few things are still missing.
Off the top of my head: lxml, pytz, simplejson (as json in the stdlib), requests and jinja2 work already. Twisted has someone working on Python 3 support. The others I don't know about.
honest question: my job is programming in python. I never had python 3 installed on a machine, being it personal, a server or a computer at work. I never felt the need to. any time I wonder why I'm not using it, I go back to the "what's new" page and I remember why. I mean, the biggest change is print not being a statement anymore? Improved UTF8 is neat, and being Italian I work with not ASCII chars all the day, but even in large projects this comes down to a couple of encodings. I mean, multi-line lambdas, optional static decorators, those would justify a jump in version and backwork incompatibility, but map returning an iterator and not a list? Meh, this is good for python 2.actual_version + 1.
> I mean, the biggest change is print not being a statement anymore?
The reasons to upgrade to Python 3 are both numerous and serious. If the only hit on your code base is to change "print this" to "print(this)", by all means upgrade. And most conversions are automated -- just run a script named "2to3":
Asking why one would want to move from Python 2 to Python 3 is like asking how much a boat costs -- if you have to ask, you can't afford the consequences. Here are some of the reasons:
A quote: "At the time of writing (July 4, 2010), the final 2.7 release is out, with a statement of extended support for this end-of-life release. The 2.x branch will see no new major releases after that. 3.x is under active development and has already seen stable releases, such as the recent 3.2. This means that all recent standard library improvements, for example, are only available in Python 3.x."
Of course the push to a new version is strong and a newer version of a product represents its future. I'm not debating this or stating that it is stupid to use the newer version, but when I see someone writing "about time!", I read it like "wow, so I can finally use Python 3 and all its game changing brand new features!", but I don't see anything new than, when programming in Python 2x, makes me think "oh, if only I had used Python 3 here!". For example, when I upgraded to .net 3.5 and I got Linq, I really felt the pain of not having it available when maintaing older code and I finally decided to migrate it all to 3.5 due to the real new features.
Python 3's improved handling of UTF-8 is by itself worth the upgrade. I've spent more time than I care to recall trying to get Python 2.x to handle Unicode correctly.
I only mention this because it's a visible change that's easy to explain in a few words. The more basic changes are mostly subtle and difficult to describe without direct experience.
> but I don't see anything new than, when programming in Python 2x, makes me think "oh, if only I had used Python 3 here!".
That's not a very sound basis for comparative evaluation. If you have only ever owned a horse, the advantages of owning a car might not be obvious. The horse can go places the car cannot, so the fact that the car gets to other places faster might be overlooked.
Having used Python 3 a bit, there are things I miss in Python 2. Like when I write something quickly and accidentally use integer division (In Py3, 1/2 == 0.5).
> Having used Python 3 a bit, there are things I miss in Python 2. Like when I write something quickly and accidentally use integer division (In Py3, 1/2 == 0.5).
That's been addressed -- in Python 3 there are now two kinds of division and two operator symbols:
>>> 100 / 9
11.11111111111111
>>> 100 // 9
11
But you have to remember to use the right symbol. :)
Sorry, I should have made that clearer. I know and like the division semantics in Python 3. It's when I go back to Python 2 that I get bitten by 1/2==0.
I know that I can use __future__ to sort that out, but when I'm writing something quickly, I often forget that until I work out why my code is misbehaving.
That sentence is of course followed by caveats about Python 3 support being experimental at this stage, but all-in-all I think this is a sign that we are finally at the tipping point for Python 3 to start gaining mainstream usage.
Thank you Django community for moving the ball forward for everyone.