The year 2019 has been one of the greatest years for the programming language Python. It was becoming popular among developers for quite some time, but this year it beat JAVA to become the most widely used language across the globe. The IEEE rankings for the top programming languages of 2019 is a classic display of Python’s charisma spread like a wildfire among developers. But, as any programming language goes through a specific lifecycle, so does Python. The Python software foundation finally took the step to formally retire Python version 2 as of January 1, 2020.
Sunsetting Python 2
Even though everyone knew this was coming, people are a little sad from the fact that the date finally arrived too soon. Back in 2014, it was Python’s principal creator and author Guido van Rossum who made the announcement that January 1, 2020, will the day when Python 2 retires. It seemed far away back then, but today the Python clock has already started the countdown and there will be no more support available from the core Python team for the sunsetting version.
Making the announcement in a conference, here’s what the team had to say, “We have decided that January 1, 2020, will be the day that we sunset Python 2. That means that we will not improve it anymore after that day, even if someone finds a security problem in it. You should upgrade to Python 3 as soon as you can”.
Migrating to Python 3
Clearly, the Python Software Foundation wants people to migrate to its version 3 as soon as possible. But few know that Python 3 was released at the end of 2008, almost nine years after the inception of language. Even though, it was created as a breakthrough with advanced features and high performance, upgrading to Python 3 isn’t that much of cakewalk. It did bring the language evolution forward by fixing a number of flaws that affected Python 2.
One of the most popular reasons why organizations were still using Python 2 was because it had accumulated multiple ways of accomplishing a particular task. However, one of the guiding features in the new version Python 3 was making sure that there was only one specific intuitive way to do a task. But, in spite of its new and amazing features, the adoption of Python 3 wasn’t as filled with enthusiasm as everyone had expected.
Resistance to Python 3
Python 3 broke backward compatibility and developers widely resisted its adoption. In the attempt to evolve the language free of any legacy constraints, it’s adoption was slowed down. Here are some of the other reasons why developers were not reluctant to migrate to Python 3-
- Python 3 has a subpar performance as compared to Python 2
- Initial lack of support for Python 3 among the third-party tools and Python libraries
- Focus on features developers did not even deem relevant in the beginning
- Excessive house cleaning etc.
But, in spite of these issues, the language grew significantly over the years and included a variety of advanced constructs in its versions such as generators and co-routines, async/await, concurrent futures, itertools along with more. Even though there has been a lot of confusion around migrating Python 2 to 3, it is now a far more understood and simplified problem. Great tools such as caniusepython3, Modernize, Futurize, pylint, etc. exist to make the task a hassle-free affair.
However, the entire hustle-bustle around Python 3’s adoption made organizations postpone the transition. And now, those who haven’t are facing the panic behind Python’s declaration that says organizations who don’t migrate are on their own and will have to pay for extended Python 2 support.
Not as Challenging as It Seems
For those who have migrated to the platform say that it has been one of the easiest things to do. Hire Python developers realized that there is a library ‘six’ that helps the transition smoothly. Also, in almost all cases, you can write Python two and three compatible code, thus enabling a piece by piece transition. Apart from this, moving to python 3 doesn’t require an entirely new set of skills, platforms or tools. All one needs is a set of good engineering practices such as keeping unit tests in shape and making sure to keep dependencies up to date.
Experts suggest that if organizations haven’t upgraded to Python 3 by now, they have wrong priorities. It’s not just about moving from Python 2 to 3 but mostly about broken security scanning and processes and dependencies that will keep hurting a team more and more down the line.
Why Organizations Must Migrate to Python 3
Python 3 brings a bunch of small improvements with this. Some of these include no default ordering, absolute import by default, new octal notations, map(), filters(), zip() becoming iterators, range() mutating into xrange(), dict.keys() returning a view instead of a list among others. But, if you still don’t find anything useful, here are some more reasons why as an organization you must migrate to Python 3-
- Building an entirely new project from scratch
- Legacy projects in your organization rely heavily on features different in Python 3
- Project is mostly based on libraries as Sci-kit learn that have plans to completely drop Python 2
- Concerned about broken processes and security vulnerabilities
Conclusion
Even though some issues like multi-line lambda remain unsolved in the new version, organizations must realize that Python 3 is not just a choice but a way to moving forward. While the transition might seem a little difficult, it is process of evolution, ultimately contributing to better decision making in an organization. Finally, Python 3 is the secret to a better and smoother process, elimination of what’s unnecessary and definitely a better life for enterprise products and developers.
Leave Comment