views:

1784

answers:

10

I ask this for deployable reasons. As in, if I write a solution in python, I feel bound to write to 2.x due to the lack of adoption of python 3. This is a major daily concern of mine, and I want to figure out what's going on.

For many of the python-based questions here, people are giving solutions that simply do not work in python 3.x.

So, I ask the question: What has prevented you from switching to python 3.x in your personal or work environment? The conversion script exists, and yet programmers (who are usually the earliest adopters of everything) seem to refuse to upgrade.

Why?

+4  A: 
  1. Compiled 3rd party modules haven't updated.
  2. Different syntax
  3. Slower integers.
  4. The #python IRC channel on freenode has in its title that its too early to switch.
Unknown
Slower integers – really? I know ints and logs are unified, so it's plausible to me, but this is the first I've heard of it. Can you give a ref?
John Fouhy
I'm too lazy to dig it up, but ints and longs being unified is the reason it is slower. So vote me up.
Unknown
Because of this: http://python-history.blogspot.com/2009/03/problem-with-integer-division.html
Daz
+3  A: 

For many of the python-based questions here, people are giving solutions that simply do not work in python 3.x.

I think you answered your own question here. The lack of backwards compatibility makes 3.0 a much harder sell than a seamless upgrade because you have to adjust your thinking and discard some programming techniques to use the new version.

Call me back when they have an upgrade script for my brain.

Chris Upchurch
+25  A: 

Django has not moved over to 3.0. That is all I need to know.

Related Questions

Most of the answers in these questions echo the same sentiments. Aside from Django, too many frameworks/libraries - NumPy, SciPy, WxPython, PyGame, Django, etc - have still not adopted it. I'm sure as hell not making the move until they do.

Paolo Bergantino
+1 for django for sure.
Electrons_Ahoy
+1 also, for OP, there is a python3.0 tag for asking questions when you need an answer specific for python 3.
Van Gale
Django. Totally.
Yuval A
+16  A: 

Because major libraries that my codebase depends upon have not released a 3.x version. (wxPython, matplotlib, numpy, etc.)

So the responsibility goes upstream from my point of view.

If all my dependencies were 3.x compatible, I'd probably have switched by now.

FogleBird
+4  A: 

3rd party tools and libraries. I'm having trouble making some things work under 2.6 (not a LOT of trouble, mind you, but some.)

As I see it, the ecosystem is one of Python's biggest strengths, and going to 3.0 at this point chucks a lot of that out the window. (In a year, I'm sure the story will be totally different.)

(Obviously, there's a chicken and egg problem here, but fortunately it's not my problem to solve, so I'll stay with 2.6 for a while.)

Electrons_Ahoy
One year later... progress, but sluggish. At least PyQt supports 3.x.
Craig McQueen
+1  A: 

Because the default installation of 2.5 on Mac OSX Leopard works just fine. I have no need to upgrade and I see no advantage to upgrading except an end to the woes of unicode.

Teifion
+1  A: 

If you are interested to move to Py3k one interesting way would be to write code in Py3k and use a 3to2 script which is being written now as a part of Google Summer of code project, on the lines of 2to3 script.

Lakshman Prasad
Does not answer the question.Also does not make sense. You propose that it would be "interesting" to use a translating script that is not even done yet? Seriously? What kind of interesting is this? The *might or might not work* variety?
foljs
+1  A: 

The operating system I use the most, Debian, does not have a Python 3 package, not even in the "unstable" (brand new) branch. Unless I compile it myself (which is quite 20th century), it means no Python3 to me.

I bet it is the same issue with many operating systems.

bortzmeyer
You can always check out the python3.1 package for experimental. http://packages.debian.org/experimental/python3.1
David Locke
As you say, it is in the experimental branch, the one "more unstable than unstable". I believe it answers the original question.
bortzmeyer
FreeBSD has a Python 3 in its "ports" (packaged software), in lang/python30
bortzmeyer
+1  A: 

Unfortunately, for the same reason as most others have said - 3rd party libraries still not having been made 3.0 compatible. For this reason, as well as that some GNU/Linux distributions (Ubuntu in my case) still comes with Python 2.6, I can't completely throw 2.x out the window yet.

However, the change to 3.0 is not a major one IMO. Except for "print" being a function and the new string formatting system, it's really more or less the same as before.

In fact, I find that most of my old scripts (those that do not depend on 3.0 incompatible 3rd party libraries) will work flawlessly in 3.0 after I update all the prints and string formatting. In some cases I've also had to change some module names (specifically stuff from the "email" module), but other than that nothing major.

Also, all the scripts I have updated for 3.x compatibility so far still seem to work flawlessly in 2.6 (but not older 2.x of course, as they lack the new 3.x syntax).

A: 

Because of the lack of backward compatibility, switching is hard, especially if there is C code involved. And although I understand the unicode/string thing may be very useful to some people, I certainly don't care about it myself.

Basically, Py3k did not solve many problem that I care about (distribution issues, versioning of modules, simplified import model).

David Cournapeau