So, why should I bother migrating? I moved to C# 7 instantly and never looked back, for example, because it has tons of stuff. But the only thing I hear about Python 3 is "it's so much better!!!111" and "strings, you need it".
So, why should I bother migrating? I moved to C# 7 instantly and never looked back, for example, because it has tons of stuff. But the only thing I hear about Python 3 is "it's so much better!!!111" and "strings, you need it".
Current Python 3 has changed a lot since the first versions of Python 3, and there is a whole host of improvements that makes it superior. None of them earth shaking but a host of them worth it. Python 3.6 was just released, and I would recommend having a look at its whats new document, to get a feel for what has changed since 2.7.
Python 2:
x = 'hello'
[x*x for x in range(5)] #=> [0, 1, 4, 9, 16]
x #=> 4
Python 3: x = 'hello'
[x*x for x in range(5)] #=> [0, 1, 4, 9, 16]
x #=> 'hello'
Python 3 has improved destructuring supportPython 2:
a, *b = [1, 2, 3] #=> Syntax error
Python 3: a, *b = [1, 2, 3]
a #=> 1
b #=> [2, 3]
Type annotations[1] are nice not because they enable typechecking, but because they tell me what the function expects. Maybe it's just the kind of programming I do, but I use a bunch of libraries with functions that take a class or function as input, except half the time they want the name to the thing instead of the actual reference.It might be though that the new text model faces more resistance in English speaking countries, because ASCIIbytes is obviously less troublesome there, so people might not see the need for Unicode.
If you are doing any sort of scientific computing there is no compelling reason to move to Python 3.
The nuances that you have to grok with the Py3 str are the same nuances you would have to grok about using the Unicode implementation of Py2 instead of the default encoding in Py2. They just made the default more complicated if you are working with data. Now they require you to add 'b' to every damn thing and they have the arrogance to claim this is the "right way" to do it.
Like someone else said earlier -- computer science strings are a sequence of bytes. If you want to encode and decode from byte strings use another type. They should make the default bytes and print utf-8 interpretation.
Oh, but then they would have Py2 and they would realize what an authoritarian goose chase Py3 has been.