Photos - Jan Kopřiva - Unsplash
Not everyone is ready for the new "python"
In 2020, Python 2.7 will be discontinued , and security updates will be suspended . Despite the fact that these plans became known five years ago - in 2014, Guido van Rossum, the author of Python, personally encouraged developers and companies to migrate to Python 3 - the process of adapting the new version is slow.
At the beginning of the year, about 60% of packages downloaded from The Python Package Index (PyPI) were version 2.7. By September, this figure decreased to 40%, but most likely it will not reach zero before the deadline .
What inhibits migration
In large companies, the introduction of a new framework or the transition to an updated technology always requires significant resources and time. In some cases, the process drags on for months and even years. This is due to the massive code base and a large number of dependencies. Facebook began to transfer the company's services to Python 3 back in 2014. It took a year to implement this project - a significant number of libraries had to be rewritten and thousands of regressions corrected. After that, the company's engineers took up Instagram - in this case, the transition took ten months. Dropbox has been migrating to Python 3 for three years now.
Some companies have strict rules for negotiating significant technology updates with the security service. Sometimes this unit even regulates the loading of PIP packets. "Security" is worried that when switching to Python 3, critical vulnerabilities will begin to appear in services. Indeed, in areas such as banking and healthcare, the cost of error can be high. So, last year, the British TSB - in the process of introducing a new IT system - ran into a bug that caused a malfunction in the mobile banking system. As a result, 1.9 million people lost access to their accounts. The organization is still dealing with the consequences.
Among other things, Python 2 still supports leading Linux-based operating systems. For example, in RHEL, users can choose which version to work with. Although the Red Hat operating system is gradually migrating to Python 3, this process is not going as smoothly as we would like. In the process, bugs are regularly found, mainly related to the operation of pointers. Debian also retains support for Python 2, but the upgrade has already begun . It is also moving slowly - engineers are consistently testing libraries for compatibility.
In any case, even after the full transition to Python 3, many will continue to work with the previous version - as some packages will be supported by companies and community enthusiasts.
What the community thinks
Residents of Hacker News in a thematic thread note that the main reason for the slow migration is the absence (until recently) of any tangible benefits from this process. There were no new functions in the language that could interest developers and push them to switch to Python 3. However, some decisions made by the authors of the language, on the contrary, spoiled the impression of programming on it. In particular, a big wave of dissatisfaction was caused by the exclusion of support for byte strings and the transition to exceptional work with Unicode. Stack Overflow also noted that the Python ecosystem lacked built-in tools for automatically translating code from one version to another. The problem was solved with the advent of utilities such as 2to3 and six .
Photos - Hitesh Choudhary - Unsplash
The functionality of Python 3 has expanded significantly in recent years. Added matrix multiplication, asyncio module for organizing competitive programming, as well as annotations of variable types , class fields, arguments and return values of functions. Python 3 support has even appeared for other popular libraries, such as scikit-learn for ML. The updated feature set should convince companies to switch to the next version of the language. And while the number of Python 3 adherents will increase significantly next year, a full transition will take a significant amount of time.
We at 1cloud.ru offer a DNS hosting service . Registered users get it for free.
Any questions related to the operation of the service will be answered by specialists from our center of competence.
Additional reading on 1cloud blog:
Will the cloud save ultra-budget smartphones
“How We Build IaaS”: 1cloud materials
Screening electronic devices at the border - a need or violation of human rights?
This is the turn: why Apple has changed the requirements for application developers