top | item 3305021

[Django] Python 3 port - all tests now pass on 2.7.2 and 3.2.2

282 points| praxxis | 14 years ago |groups.google.com | reply

53 comments

order
[+] jacobian|14 years ago|reply
You can find the code here: https://bitbucket.org/vinay.sajip/django. I'm still trying this out myself, but one interesting thing to note is that Vinay chose to use a single-source strategy instead of running things through 2to3.
[+] bdarnell|14 years ago|reply
Impressive! Is python 2.5 still supported? In my experience (with Tornado) it's difficult to get a single codebase to work on 2.x and 3.x without using some of the features introduced in 2.6.
[+] jtchang|14 years ago|reply
Freaking awesome. I have been watching the Python community slowly move to Python 3 and to be honest it seems like the smoothest and most well planned transition I've gone through.

Really early on they said Python 3 would break backward compatibility. Normally I'd bitch and moan but they gave us plenty of time and knew it would be a slow process.

Hopefully everyone will move to python 3 soon and we can just leave 2.x cleanly.

[+] Sami_Lehtinen|14 years ago|reply
Way cool. Hopefully this also means that more hosters start supporting python 3.X. It's hard to find python hosting and even harder to find python 3.X hosting. Often VPS has been the only practical solution.
[+] yuvadam|14 years ago|reply
This is an amazing milestone.

Once the Django community starts adopting Py3K, it's only a matter of time before the rest of the Python community follows suit.

[+] mynegation|14 years ago|reply
Django is not the only killer app for Python. In fact I would argue that scientific computing (numpy, scipy, pandas and friends) is no less, and in fact, may be more of a factor in transitioning to Python 3.
[+] dagw|14 years ago|reply
Django is a tiny part of the Python community as a whole. I've been doing python development for going on 12 years, and half the programmers I know use python professionally in one capacity or another, and I can honestly say I don't know a single person who gets paid use Django.
[+] myoffe|14 years ago|reply
Sounds like great news! Will this be merged into the official Django project?

And, what does it mean for developers using Django? Will I be able to run official Django 1.X on Py3k soon?

[+] po|14 years ago|reply
Yes, if it is accepted into the core then it means you will be able to run Django on Python 3 soon. Keep in mind though that:

* This port was basically done in a week so many parts still need analysis and discussion. It's a huge step though.

* When Django says 'soon' it might not be what you expect if you are not used to the project. This is the type of thing that depends on a ton of compatibility testing. Django makes very measured, deliberate steps and this will likely not make the 1.4 release.

* Your Django project may depend on non-python3 libraries that keep you on the 2.x branch. You have to make sure all of your libraries are compatible. This does increase the pressure on those libraries to get compatible though. (See http://python3wos.appspot.com/)

[+] thedjpetersen|14 years ago|reply
Congratulations to the Django team. This is a big step towards to the adoption of python 3. The more big libraries that are ported the sooner we will see wide spread adoption.
[+] random42|14 years ago|reply
This is a wonderful effort, but I dont understand point of the single source approach, as 3.x branches are not backward compatible with 2.x branches.

Can someone (Vinay?) explain a simpleton (like me :)), the reasoning behind using the single-source approach?

[+] FraaJad|14 years ago|reply
Maintaining two code bases is difficult than maintaining one, isn't it?
[+] flexterra|14 years ago|reply
Wow, this was really fast. Congrats to the team.
[+] hello_moto|14 years ago|reply
Seems like a one-man effort as opposed to the team (or maybe I'm wrong).
[+] shuzchen|14 years ago|reply
This is totally cool. I applaud these efforts. That said, I'm more interested in switching to pypy than to py3 at the moment.
[+] briancurtin|14 years ago|reply
Is this based on Martin von Löwis' previous 3.x porting work?
[+] jacobian|14 years ago|reply
Yes, although in the end Vinay moved in a different direction (single shared source instead of 2to3). I'm really interested in diving in and figuring out some of the pros and cons of that approach; I hadn't thought it as going to be possible on a codebase like Django.
[+] Slimy|14 years ago|reply
I'm one of the students from UofT that helped with this project. Basically, my group for one of our Software Engineering courses had the assignment of helping with this enormous task. We didn't finish (this was two years ago), but we did make a lot of progress (fixing bugs to get the tests to pass in both versions). It was one hell of a goal so it's great to see this finally done!
[+] azth|14 years ago|reply
Was Greg Wilson teaching the Software Engineering course? :)