Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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":

http://docs.python.org/2/library/2to3.html

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:

http://wiki.python.org/moin/Python2orPython3

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."

A more complete list of the changes:

http://docs.python.org/3/whatsnew/3.0.html

Bottom line -- if you don't migrate to Python 3, over time the corner you're painting yourself into will become smaller and smaller.


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: