Member-only story
The Limits of Python
Python is the go-to language for many software projects. It is incredibly productive, has an endless amount of useful libraries and perhaps most importantly- there is a large amount of developers who are highly skilled in the language.
But, there are projects where Python may not be the ideal choice. Like all other languages, it has it’s downsides. Luckily, for most projects, these downsides can be avoided. However, if they can’t, then maybe you need to reconsider Python as an ideal choice for that part of your project.
In this article I will examine a few of Python’s limitations, the possible workarounds, and alternative solutions.
Parallelism
If you have been studying the internal functioning of Python, you’ve probably heard of the Global Interpreter Lock (GIL). It is essentially a giant mutex, which prevents multiple threads from accessing a resource simultaneously. A mutex (short for mutually exclusive lock) is basically a mechanism that prevents one thread from accessing a memory address, while another thread is reading or writing to it. The main benefit of mutexes is that this mechanism prevents data races, which can lead to bugs that are extremely hard to identify.
The GIL was implemented mostly because Python heavily relies on certain C libraries that are not thread safe. Since these C…