Python is very popular now, with simple syntax and powerful functions. Many students want to learn Python! So the little ones have prepared high-value Python learning video tutorials and related electronic books for everyone. Welcome to receive them!
There are still 4 months, 1 day and 3 hours before the retirement of Python 2.7. On the Pythonclock website, the countdown numbers are changing dynamically. Recently, the National Cyber Security Center (NCSC) of the United Kingdom advised developers to abandon the use of Python 2. With the end of the Python 2 life cycle (January 1, 2020) approaching, the National Cyber Security Center (NCSC) of the United Kingdom is concerned that continued use of unsupported modules is at risk of data security, because Python core developers will no longer provide them Security updates for this version. Although users can still choose to pay a third party to continue using Python 2, many projects have stopped supporting Python 2 (including TensorFlow, Requests, scikit-learn, Apache Spark, pandas, etc.). So, for Python 2.x users, it’s time to turn their attention to Python 3.
Since its release in 2008, Python 2.0 has gone through more than ten years. Its last major update to Python 2.7 was in 2010. Python 2.x is an excellent language version, but at the same time it also brings considerable historical baggage. Lexy Munroe listed its flaws in its blog, "For example, it has two integer types; it has an annoying Unicode encoding problem; it confuses lazy and eager functional tools; it has a standard library, but it has a very Huge; it prides itself on strong typing, but it has occasional ridiculous results None <3 <"2". In general, some of its "dark corners" contain too much historical baggage from the Python 1 era. "
Since fixing these issues may break existing code, almost all code written for 2.0 can still run on 2.7. Therefore, a new version of Python 3, which is not very compatible, came into being. At the beginning of the design, the expectation of Python 3 was that users would directly transfer to the new version, thus giving up the use of Python 2. In fact, most libraries want to run on Python 2 and Python 3 at the same time, which is difficult to work in the beginning. Many people know that the Python community is always very resistant to change. After Python 3.0 was released in December 2008, it took a full four years until January 2013 when its monthly downloads surpassed Python 2.
Realizing that many users are still using Python 2, Python developers have extended support for Python 2.7 from 2015 to 2020. Since developers only fix bugs and restrict all new features to Python 3, many projects have reduced support for Python 2.7.
Now, most of PyPI's popular packages can run on Python 2 and 3, and new packages are added every day. In addition, many key Python projects have promised to stop supporting Python 2 as soon as possible.
The status of each branch of Python
According to JetBrains Python developer survey, the vast majority of users (84%) have switched to Python 3. Among them, 54% use Python 3.6 and 30% use Python 3.7.
It seems that the conclusion seems obvious, you should start using Python 3, because it is the future of Python!
However, in fact, the choice of Python version depends on the actual application of the company. Many banks and financial companies still use Python 2.7. Last year, when Python announced that Python 2 will officially end in 2020, Hacker News users said that millions of people in the industry are still using Python 2.7.
Let's look at a set of the latest data. According to the survey results of the Python Package Index, among the top ten popular Python packages, Python 2 downloads of the first four packages are larger than Python 3, and even Python 3 is the most popular one. Some packages are still suitable for Python 2.
Earlier this month, PyPy stated that as long as PyPy exists, they do not intend to give up support for Python 2.7. Foreign media Packt Hub explained that this preference for Python 2 is not only because the first version of PyPy was implemented in Python 2. Python 3 has only recently entered this version, which is also a key part of the PyPy ecosystem. RPython is a dynamic The language implementation framework is based on Python 2.
Therefore, the departure of Python 2 will also bring some problems. Rich M, a researcher at the National Cyber Security Centre (NCSC) in the UK, summarized the following points in his official blog:
As mentioned earlier, popular projects like Numpy and TensorFlow have promised to stop supporting Python 2.x in 2020. This means that if you want to use the latest features of your favorite modules, you must use Python 3. The longer you wait for an update, the more Python 3 versions of the changed dependencies will be, and the more difficult the update will be.
2. May hinder other developers
If you maintain a library that other developers rely on, it may hinder its update to Python 3. This means that you invisibly increase the security risks of other developers. You may not publish any code outside your organization, but consider colleagues who might use your code internally.
3. Missing new features
Python 3 has many new features that Python 2 users have not tried, including:
The National Cyber Security Center (NCSC) recently listed the security risks and possible code damage in existing applications as the main reasons why users need to abandon Python 2 as soon as possible. The agency warned that companies that do not invest in migrating to Python 2.x may end up facing the same situation as Equifax or WannaCry. "Knowing that there is a safe version available, you still take the risk and decide to continue using Python 2 after the end of the life cycle. You will need to bear all the risks of using unsupported software."
To facilitate the transition for users, the Python team also provides a variety of informative guides. (For example: Porting Python 2 Code to Python 3; Should I use Python 2 or Python 3 for my development activity?) But anyway, Python 2.x still has a group of loyal fans. Now, it's time for them to make a choice.
ps: Friends who want to learn python recommend here the python zero-based system I built to learn communication buckle qun: 322795889, there are free video tutorials, development tools, e-book sharing in the group. Professional teachers answer questions! Learn python web, python crawler, data analysis, artificial intelligence and other technologies if you don’t understand, you can join in to communicate and learn together, and make progress together!
Alright! The article is shared with the readers here
Finally, if you find it helpful, remember to follow, forward, and favorite