欢迎来到游易

Python 2 and 3 coexisted for 11 years, and we will say goodbye to it in the new year

发布时间:2020-01-05

Python 2 and 3 coexisted for 11 years, and we will say goodbye to it in the new year

Both 2 and 3hon 3.9 have entered the dev version of 2020, and Python 2 will finally be with me

The first version of Python 2 was released on October 16, 2000, and this year is exactly the 20th year. Python 3 was released on December 3, 2008, but due to a large number of refactorings at the bottom of the 3.0 version (mainly Unicode and C API changes), it is not completely compatible with Python 2, so the official did not stop maintaining Python 2 .

Since then, 2 and 3 are still releasing new versions, and the official wants to transition to the new version in a smooth way. However, not all community contributors have the energy to maintain two versions at the same time, and many open source libraries have stopped at 2.X.

The two editions coexisted for 11 years.

2 to 3

Fortunately, Python 3 has been updated with more and more unique features and performance optimizations, coupled with the continuous efforts of the community to promote it. Among the beginners who have grown rapidly in recent years, most of them are recommended to use the 3.X version as a starting point. Version, version 3 has only dominated in recent years.


Finally, the Python core development team announced that it will gradually stop supporting Python 2 in 2020, but did not give a specific time.

In 2017 NumPy officially announced that it will stop supporting Python 2 on January 1, 2019. After that, development teams such as pandas and Jupyter notebook announced that they would stop supporting 2.X version.

In 2018, Python founder Guido van Rossum stated in the official mailing group that they will stop supporting Python 2.7 on January 1, 2020, which is also the last version of 2.X.


He wrote in the email:

Stop playing word games! The EOL (discontinued) date for Python 2.7 is January 1, 2020. Next, there will be no updates and no source security patches. After this date, no support will be provided by the core Python developers, PSF, and python.org. If you still want support, you have to pay the relevant business costs. Of course, it is open source, so we welcome everyone to fork.

We originally decided 2015 as the EOL date, and then postponed it to 2020. We have enough time for everyone, and the core developers have worked hard for too long. Also, frankly, I don't find it a bad thing to disable Python 2.7.

After 3

However, stopping the update will not have much impact, because according to JetBrains' latest Python developer report, nearly 90% of developers have already used the Python 3 version.


We believe that less than 5% of developers will use Python 2 in 2020.

If you have code that wants to migrate Python 3, don't forget to try the official 2to3 migration tool.

In addition, the 3.9 version has a dev version, and the version number left for Python 3 is also over (unless you use two digits). We will wait and see how Python will go in the future.




微信客服