7 ms·
Django's future, and Python 3
- turbulence 15y agoI thought I read somewhere that the django trunk already was ported to py3 and all tests passed?
- mattdeboard 15y agoMaybe I spent way too long at PyCon but I'm getting very weary of hearing about Python 3. Why is anyone surprised, or cheered, or dismayed, or excited, that one of the flagship Python projects will eventually be moving to Python 3 (experimental!) compatibility? This is a sincere question by the way, just tempered by post-PyCon weariness.
- jacobian 15y agoIf you think you're tired about hearing about Python 3 try sitting in my seat! I got asked "when's Django moving to Python 3?" about thirty times a day at PyCon, and I think the other core devs did, too. We realized that although we had a plan in mind we hadn't communicated it well. Hence the blog post. Sorry to bore you. Back to your regularly scheduled hacking.
- sown 15y ago> I got asked "when's Django moving to Python 3?" about thirty times a day at PyCon, and I think the other core devs did, too. Get custom T-shirts printed? ;)
- superxor 15y agoThanks for the post, the road map should be a lot more clearer for users.
- timc3 15y agoWonder how many times you got asked how long you are going to hang on to Python 2.5 or even whether you/Django core devs get asked why can't they have Python 2.4 support. Not that I care that much for environments stuck in 2.4 land, its last update was 7 years ago.
- mattdeboard 15y agoIt's not that this post bored me, it's the "This is amazing/great/terrible/stupid" reaction to the news things are getting ported. Progress, time marches on, etc.
- grokaholic 15y agoDjango's lack of Python 3 support is big reason Python 3 adoption is slow, at least in the web dev faction of Python's community. Why get comfy with Python 3 when you must remain attuned to the conventions and quirks of 2.x in order to use Python's most popular web framework? Folks keep talking about Python 3 because they really want to use it, but have reservations about adopting 3 when 3 isn't supported by useful frameworks. Once Django supports Python 3, that reservation vanishes. Python 3 will be adopted by more people and get support from more frameworks. tl:dr; Django's popularity holds dev community captive to Python 2.x, slows adoption of Python 3. Django team announces Python 3 support not in distant future but near future. Folks get excited. "About damn time."
- rlander 15y agoPython != Web frameworks You're severely underestimating the impact that the scientific computing community has over Python 3's slow adoption.
- cdavid 15y agoI don't understand your statement. Numpy has been ported on python 3 more than 18 months ago, and scipy followed quickly afterwards. Our download stats show rather little interest for python 3, BTW.
- dagw 15y agoThe numpy and scipy core may have been ported, but many of the Scikits (add on libraries to scipy), third party libraries and surrounding tools haven't. So most people will still go with python2 just in case they might need to use one of those tools or libraries later down the road.
- superxor 15y ago+1 I had started learning Python 3. But my job now is on Django, so I am forced to use Python 2. I know a good number of people who had the same problem.
- 15y ago
- randlet 15y agoGreat news. The two biggest hurdles for Python3 adoption were/are Numpy/Scipy and Django. Now that Numpy/Scipy both officially support Python 3.x[1] and with Django coming soon, I expect a lot of people will make the transition to Python3.x for new projects. 1. http://scipy.github.com/faq.html#do-numpy-and-scipy-support-python-3-x http://scipy.github.com/faq.html#do-numpy-and-scipy-support-...
- togasystems 15y agoDo you know of any other large hurdles preventing the adoption of Python 3?
- SiVal 15y agoIt may sound strange, but we're the other way around. With Python 3 being the only future of Python, the inability of something like Django to support Python 3 is, for us, a hurdle to adopting Django, not Python 3.
- peteretep 15y agoThis has retarded any progress of mine toward learning Python. Every so often the urge strikes me, and then I remember that I want to learn Python 3, and then I remember that means no Django, and I tend to go and learn something more fun and less practical...
- lloeki 15y ago> learning Python By any means, if you feel the urge, you really should help yourself and scratch that itch. I understand that for someone new to python (hence lacking the knowledge to get what's different between 2 and 3) you might feel uneasy about it, but really you should not. Just learn py2.7 (+ django if that's you want) now, and bulletproof your code by using u"", b"", .encode and .decode at the edge when needed, also 123L in your code, together with from __future__ import division, print_function, and whatnot. The remainder is mostly syntax (like except) or namespace (like http.server) changes and will get caught and thus easy to fix when you try to run in py3 (contrary to if you don't use u""/b"" as values can "move" through code and blow up in a completely unrelated area). I might be forgetting something, but that's the gist of it. As for learning, really you will have zero trouble acclimating yourself to any breaking change py3 introduces. The trouble only lies in existing, 'legacy' code, not for the one you write from scratch straight in py2.7, and especially if you aim for compatibility with the provided forward-compatibility features of python.
- taybenlor 15y agoDjango team: "We're planning to shift to the 4 year old Python 3 over the next 2 years" Rails team: "New Ruby alpha? Deprecate everything!"
- spitfire 15y agoNow which would you bet your business on? It'd be nice if things could move a little faster. But the alternative is wild-wild-west.
- taybenlor 15y agoIn both worlds high-stakes businesses are going to stick to the "stable" release while personal projects explore the new waters. Django's failure to make the shift has resulted in all those personal projects not making the shift. Django, from my point of view, seems to be approaching this from the wrong direction. They are waiting for the community to shift to Python 3, but at the same time the community is waiting for Django to shift.
- SoftwareMaven 15y agoI think a lot of people who are really interested in shifting to Python 3 for those experimental projects are just using different web frameworks. The real problem is that Django isn't the only problem. I've started cataloging the packages that are supporting Python 3 in my project, and there are still several that are critical to it that haven't made the transition. My web framework is the least of my concerns in that regard (considering it already supports Python 3).
- ubernostrum 15y agoEr, no, we're not "waiting for the community to shift". When Django 1.0 was released, we supported minimum Python 2.3. Dropping 2.3 and then 2.4 were major logistical hurdles; they were incredibly widely deployed, and were the stock Python for many platforms with long-term support. So it was going to take a while, no matter what, for us to sensibly deprecate those Python versions without just throwing a bunch of our users under a bus. And, of course, deprecating everything older than 2.6 is a prerequisite for starting to actually adopt 3.x. Meanwhile, the first few releases in the Python 3 series weren't really meant for widespread adoption, ever. They were there so people could start getting a taste of Python 3 and working out a migration process while shaking out remaining issues for Python itself. We are now at a confluence of two very happy things: 1. We've dropped our support for the older Python 2.x releases, without just screwing over a bunch of people, and by year's end we'll be a minimum-2.6 project, and 2. Python 3.2 (the current 3.x) is really quite a nice release, and Python 3.3 (later this year) looks like it'll really put the spit and polish on the Python 3.x series, meaning it's a very attractive time to be targeting Python 3. This is the first time we've realistically been in a position to actually make the jump, and we're taking that opportunity.
- eta_carinae 15y ago> Python 3 is the future of the Python language ... and it always will be.
- pilif 15y agoI think it's crazy that they are only now talking about dropping support for Python 2.4 which came out in 2004 and has been replaced by Python 2.5 in 2006. So only now they are moving from depending on 8 years old technology to depending on 6 years old technology. The reason for this is probably the proliferation of really old versions in the default installation of still supported OSes like RHEL. Worse: Due to the fact that these distros largely depend on the Python installation they came with, it's likely that admins are reluctant to touch anything python related on the system. Compare this to ruby/rails where the common practice is to treat system ruby as a hands-off thing: Usually, the deployment payload just includes its own ruby (using rvm or rbenv). This allows for much less conservative minimum requirements. Being forced to constantly target way outdated software during development is really annoying and kills motivation as you are always reminded that if only you could update, you would be spared re-implementing feature x or you could use much more expressive code while implementing feature y. And don't get me started on PH-4.x is good enough-P.
- themanr 15y agoDjango's conservatism in this regard doesn't really impact on application developers building on top of Django. Usual practice is to use virtualenv which allows for an up to date python on OSes with an ancient system python.
- tomkr 15y agoIt is perfectly possible to use a deployment-specific version of Python, just like it is with Ruby. But there are organizations where using old technology is (unfortunately) the status quo. This means Django gives you the possibility of still running it in these environments. Hell, there's loads of companies using older versions of Windows and IE. Is it optimal? No, but that's something bureaucracy tends to do. I am not trying to say Django is a better framework better for making this decision, but it is a decision that makes sense in the Python context, which is careful about breaking backwards compatibility. There's no reason to stop a developer who has that choice to work with Python 2.7 though (this is actually recommended in the FAQ). There is no need to touch the system's Python to do that.
- rmc 15y ago
- fauigerzigerk 15y agoI don't understand these guys (and girls?). The language sounds like Oracle or SAP talking about migrating WalMart to a new inventory management system. If "porting code is relatively straightforward" it would be a good idea to get that port done and let people decide for themselves when to use the new version. I don't understand what makes phraseology like this useful to anyone but a corporate lawyer: "the Django project is and will remain committed to achieving Python 3 compatibility" Yes, I know, I'm not supposed to talk like this about work being done by volunteers free of charge. It's of course their right to do whatever they like. My anger is more about the Python 3 migration going off the rails in a way that poses an existential threat to my favorite programming language. Django isn't helping at all to say the least.
- jacobian 15y ago> If "porting code is relatively straightforward" it would be a good idea to get that port done and let people decide for themselves when to use the new version. In fact, that's exactly what we're doing. Django's going to support Python 2 for quite some time yet; this move will simply let those who want to switch to 3 do so. > I don't understand what makes phraseology like this useful to anyone but a corporate lawyer: "the Django project is and will remain committed to achieving Python 3 compatibility" Because we weren't clear that Python 3 support was in the pipeline some folks in our community started to wonder if we planned to move the Python 3 at all. That's pretty much the point of the post: to clarify that we do indeed plan to port to Python 3 (and when). How would you have worded it differently? > Yes, I know, I'm not supposed to talk like this about work being done by volunteers free of charge. That's not true at all: if you have substantive critiques to make, then you should make them. We try incredibly hard to listen to our critics and take away what we can. However, your criticism here is pretty thin and rather personal -- seriously, accusing a bunch of volunteers of being like Oracle or SAP? Low blow, man, low blow. It's hard for me to figure out exactly why you felt compelled to post this criticism, so it's hard to figure out what the action you'd like us to take. > My anger is more about the Python 3 migration going off the rails in a way that poses an existential threat to my favorite programming language. Django isn't helping at all to say the least. OK, so here we go -- there is something you'd like to see us doing differently. But what?
- rhizome31 15y agoHere is a Python3 packages listing on PyPI: http://pypi.python.org/pypi?:action=browse&c=533&show=all http://pypi.python.org/pypi?:action=browse&c=533&sho... There's some interesting stuff for web developers in there: Pyramid, Bottle, SQLAlchemy, pymongo3, Mako, Jinja2, nose, etc. It seems that the whole web development stack is pretty much covered. Although it's not listed there, Tornado should also run on Python3. I considered starting my new project with Python3 but eventually sticked with Django because of the time-saving reusable apps available, but it's interesting to note that building web apps with Python3 should already be feasible.
- mladenkovacevic 15y agoI'm sorry for the noob question, but how much additional performance/functionality/flexibility could be gained by moving to Python 3? Maybe my standards are too low since I am using Django as a vehicle to learn programming and web-development as a hobby right now, but as far as I can tell the Python/Django environment seems to work exceptionally well meeting, and even exceeding, its intended objective (The web framework for perfectionists with deadlines) It seems a lot of people have this child-like concept of time where a few months is a "long time" and upgrading to the latest and/or greatest thing is so much of a priority that they are regarding it as a "fix". But as far as I can tell nothing is broken by having Django run on 2.x. If a bicycle works really, really well; is replacing the chain a top priority?
- tferris 15y agoDiscussing Django/Python on HN isn't easy—slightest criticism leads to immediate downvoting, outfaded comments and lowered karma. People either avoid strong opinions or just stay away from Django/Python threads. So, it's very hard to get an good understanding and unbiased opinions on various web framework compared to Django.