I may be in the minority with this here, but I mostly agree with this post. Python 2 is a simpler, and possibly more elegant language than Python 3.
It's true that most of these new features are optional, but that doesn't change that code tends to be written differently in these two languages. I think the relationship between Python 3 and Python 2 is similar to the relationship between C++ and C in that regard.
The goal that all new Python code will eventually be written in Python 3, I don't think will ever be achieved [1]. Personally I'm not using Python much these days, but when I do use it, I still prefer 2.7
What does Python3 require of you that isn't necessary in Python 2? Print as a function is my only example.
Python 3 lets you continue writing the same same simple stuff as ever. It also provides a bunch of other power that you can _choose_ to use.
The OP's example is such a strawman it's hard to take seriously. If you're writing little scripts (or teaching someone some introductory programming) You don't need to use decorators or type annotations or asnyc/await. If you're Dropbox and you've deployed 4 million + lines of Python, then maybe type annotations make sense for you, and there they are.
What is there about 2.7 that you prefer? The thing that most surprised me after finally moving to python 3 full-time a few years back, was that it was so completely painless.
That's true as long as I'm the only person working on the code. What happens when I need to collaborate with others? Am I gonna be the one to say (the equivalent of), you can't submit this perfectly valid and idiomatic C++ code, you've gotta remove all the templates first?
Choosing Python 2 when I can is like setting in place a simpler coding standard.
>I may be in the minority with this here, but I mostly agree with this post.
Which part of this incoherence are you most fond of?
* The part where he gives an example of "simple" python 2 hello world and pretends that the equivalent python 3 isn't exactly the same thing with two added brackets ( ) ?
* The example he does give instead which isn't even valid python.
* The part at the end where he gets confused between type safety and static typing and declares a preference for C based upon that.
> Personally I'm not using Python much these days, but when I do use it, I still prefer 2.7
Why? It mystifies me utterly that people think that having the option to do something is a burden. What is it about asyncio just sitting there in the stdlib that you find heinous? I don't use the shelve package either, but I never thought "I need to find a language where I can't easily import this monstrosity".
The fact it's there means you'll probably come to a point where you'll have to interact with it by way of someone else's library, unless you NIH everything.
It's true that most of these new features are optional, but that doesn't change that code tends to be written differently in these two languages. I think the relationship between Python 3 and Python 2 is similar to the relationship between C++ and C in that regard.
The goal that all new Python code will eventually be written in Python 3, I don't think will ever be achieved [1]. Personally I'm not using Python much these days, but when I do use it, I still prefer 2.7
[1]: https://semaphoreci.com/blog/2016/11/11/python-versions-used...