Python 3.13: Disabling the GIL and Exploring the JIT Foundation

ArjanCodes////3 min read

The New Interactive Interpreter and REPL Experience

Python 3.13 introduces a transformed Read-Eval-Print Loop (REPL) that feels significantly more modern. The most immediate change involves color support; tracebacks and error messages now highlight specific syntax errors in vivid colors, making it faster to identify missing brackets or invalid arguments. Beyond aesthetics, the interpreter provides smarter suggestions. If you mistype a keyword argument like maxsplit as MaxSplit, the Python interpreter explicitly suggests the correct alternative.

Python 3.13: Disabling the GIL and Exploring the JIT Foundation
The New Python 3.13 Is FINALLY Here!

Furthermore, the REPL now supports direct commands. You no longer need to call exit(), quit(), or help() as functions with parentheses. Simply typing the word executes the command. For those pasting large code blocks, the new "paste mode" (toggled with F3) prevents the interpreter from misinterpreting indentation during the transfer, a common headache in previous versions.

Refined Typing and Module Enhancements

Static typing continues to evolve with the inclusion of PEP 705, which adds a ReadOnly qualifier for TypedDict. This allows developers to explicitly mark dictionary items as immutable for type checkers, though Python still ignores these at runtime.

from typing import TypedDict, ReadOnly

class Point2D(TypedDict):
    x: float
    y: float
    label: ReadOnly[str]

p = Point2D(x=1.1, y=2.2, label="Origin")
# Type checkers will flag the next line:
p["label"] = "New Label"

The standard library also saw the removal of 19 "dead batteries"—deprecated modules like crypt, telnetlib, and chunk. Meanwhile, the math module gained a fused multiply-add (FMA) operation. math.fma(x, y, z) computes (x * y) + z with a single rounding step, preserving precision that is usually lost in intermediate calculations.

Incremental Garbage Collection and Performance Foundations

Python 3.13 revamps the cycle garbage collector to be incremental. Previously, a garbage collection cycle could pause the entire program (stop-the-world) to clear circular references. By performing this work in smaller increments, the interpreter reduces maximum pause times by an order of magnitude, especially for applications with large memory heaps.

This version also introduces an experimental Just-In-Time (JIT) compiler. When enabled via the --enable-experimental-jit build flag, it converts some bytecode into machine code. While current benchmarks show negligible speedups—and even some regressions in I/O heavy tasks—this JIT serves as the structural foundation for massive performance leaps in future releases like Python 3.14.

The Free-Threaded Interpreter and GIL Removal

A separate executable now offers a "free-threaded" mode, allowing you to disable the Global Interpreter Lock. This is a monumental shift for multi-core processing. In standard Python, the GIL prevents multiple threads from executing Python bytecode simultaneously. With the GIL disabled, multi-threaded CPU-bound tasks can finally run in true parallel.

However, this comes with a trade-off. Single-threaded code currently runs slightly slower in the free-threaded version due to the overhead of new thread-safety mechanisms. Developers must decide if the parallel throughput justifies the single-core performance hit. It remains an experimental feature, requiring specific installation (e.g., 3.13.0t via pyenv), but it marks the beginning of a thread-safe, multi-core future for the language.

Topic DensityMention share of the most discussed topics · 8 mentions across 7 distinct topics
Python 3.13
25%· products
Arjan
13%· people
PEP 705
13%· products
pyenv
13%· products
Other topics
25%
End of Article
Source video
Python 3.13: Disabling the GIL and Exploring the JIT Foundation

The New Python 3.13 Is FINALLY Here!

Watch

ArjanCodes // 20:39

On this channel, I post videos about programming and software design to help you take your coding skills to the next level. I'm an entrepreneur and a university lecturer in computer science, with more than 20 years of experience in software development and design. If you're a software developer and you want to improve your development skills, and learn more about programming in general, make sure to subscribe for helpful videos. I post a video here every Friday. If you have any suggestion for a topic you'd like me to cover, just leave a comment on any of my videos and I'll take it under consideration. Thanks for watching!

What they talk about
AI and Agentic Coding News
Who and what they mention most
Python
27.3%3
Python
18.2%2
Python
18.2%2
3 min read0%
3 min read