Global Interpreter Lock Optional in Python 3.13

Python’s Global Interpreter Lock (GIL) may finally be coming to an end. The Python Steering Council recently announced that they are accepting PEP 703. This PEP proposes adding a build configuration (--disable-gil) to CPython, which will turn off the GIL.

The Python Global Interpreter Lock or GIL, is a mutex or lock that only ever allows the Python interpreter to run in a single thread.

You can read more about this topic in the What is the Python GIL? article that was published last month.

What About Python 3.12?

Of course, the earliest you’ll get to try this new build config flag is in early builds for Python 3.13, which probably won’t be available until late in 2023 or early 2024.

In the meantime, you might want to read up on PEP 684, which allows sub-interpreters to work in Python 3.12. You can start playing around with those in the release candidate builds for 3.12 now.

Wrapping Up

These are exciting times in Python land. While there aren’t any new core features like structural pattern matching in 3.10, there are still some important improvements and changes coming to the language that will impact Python in profound ways.