Yesterday, the team behind Python posted details about the sunsetting of Python 2. As announced before, post January 1, 2020, Python 2 will not be maintained by the Python team. This means that it will no longer receive new features and it will not be improved even if a security problem is found in it.
It's (even more) official: support for Python 2 ends 1/1/2020. Read why, and what you should do: https://t.co/48ihncvHxL
— Guido van Rossum (@gvanrossum) September 9, 2019
Why is Python 2 retiring?
In the detailed post, the Python team explains that the huge alterations needed in Python 2 led to the birth of Python 3 in 2006. To keep users happy, the Python team kept improving and publishing both the versions together. However, due to some changes that Python 2 couldn’t handle and scarcity of time required to improve Python 3 faster, the Python team has decided to sunset the second version.
The team says, “So, in 2008, we announced that we would sunset Python 2 in 2015, and asked people to upgrade before then. Some did, but many did not. So, in 2014, we extended that sunset till 2020.”
The Python team has clearly stated that January 1, 2020 onwards, they will not upgrade or improve the second version of Python even if a fatal security problem crops up in it.
Their advice to Python 2 users is to switch to Python 3 using the official porting guide as the former will not support many tools in the future. On the other hand, Python 3 supports graph for all the 360 most popular Python packages. Users can also check out the ‘Can I Use Python 3?’ to find out which tools need to upgrade to Python 3.
Python 3 adoption has begun
As the end date of Python has been decided earlier on, many implementations of Python have already dropped support for Python 2 or are supporting both Python 2 and 3 for now.
Two months ago, NumPy, the library for Python programming language officially dropped support for Python 2.7 in its latest version NumPy 1.17.0. It will only support Python versions 3.5 – 3.7.
Earlier this year, pandas 0.24 stopped support for Python 2. Pandas maintainer, Jeff Reback had said, “It’s 2019 and Python 2 is slowly trickling out of the PyData stack.”
However, not all projects are yet fully on board. There has also been efforts taken to keep Python 2 alive. In August this year, PyPy announced that that they do not plan to deprecate Python 2.7 support as long as PyPy exists.
There is no plan to deprecate the 2.7 version of PyPy, basically for as long as PyPy exists. RPython is based on Python 2, which is not really realistic to change, so we need PyPy2 to bootstrap. Documented here: https://t.co/SGmZpOqPbW https://t.co/m0VBPOMUoB
— The PyPy Project (@pypyproject) August 10, 2019
Many users are happy to say goodbye to the second version of Python in favor of building towards a long term vision.
Happy to see this happening Guido. Congrats.
— Michael Kennedy (@mkennedy) September 9, 2019
Finally! It's been long enough and essentially the only thing stopping people from switching over is old code which probably needs to be rewritten anyway, and old textbooks.
— Daniel Meskin (@MeskinDaniel) September 10, 2019
A user on Hacker News comments, “In 2015, there was no way I could have moved to Python 3. There were too many libraries I depended on that hadn’t ported yet. In 2019, I feel pretty confident about using Python 3, having used it exclusively for about 18 months now.
For my personal use case at least, this timeline worked out well for me. Hopefully it works out for most everyone. I can’t imagine they made this decision without at least some data backing it up.”
Head over to the Python website for more details about about this news.
Latest news in Python
Introducing OpenDrop, an open-source implementation of Apple AirDrop written in Python
Poetry, a Python dependency management and packaging tool, releases v1 beta 1 with URL dependency