In recent times, those use cases have largely been data science, machine learning, web scraping and general automation. While Python wouldn’t be your first port of call for a GUI app, there’s a library for everything (and there’s a reason Python is now the most popular language).
Even Python’s reputation as a slow language has been eroded in recent times, with libraries like Cython that help compile your code into C after the first run, and better libraries for concurrency and multithreading. The latest versions of Python have begun to improve on CPython – it’s still early days in the long run, but it’s encouraging to know this will be fully supported.
It’s this kind of code conversion to a lower-level language that can speed up academic applications of Python by a thousand percent or more, combining the user-friendliness of Python’s libraries with the grunt of the lower-level languages:
But not everyone needs to dive that far in, as Python can be exceptional for automating office processes, or any kind of mundane task that feels like turning a crank. Courses and books like Automate the Boring Stuff With Python have been massively successful and probably contributed to its rise to the top. (The course is a fantastic start and I recommend it. Learning to code is empowering!)
Python creator Guido van Rossum is hoping to improve the language’s speed by 2x or even 6x in 3.11, though he said, “We’re far from certain we will reach 2x,” and said he’s “optimistic and curious”.
Software at Scale 34 – Faster Python with @gvanrossum
– Why work on Python performance
– How to speed up the interpreter while maintaining backward compatibility
– Why JIT is an overloaded term
— Utsav Shah (@utsav_sha) October 5, 2021
Now working together with Microsoft, van Rossum is wary of the mistakes made in the decade-long upgrade from 2.x to 3. But with improvements to the interpreter, it’ll have speed benefits for anyone doing CPU-intensive tasks.
That won’t include much of the machine learning/Tensorflow crowd that leverages GPUs, or code that already uses C, such as NumPy. But it’ll still help a lot of people in the near future.