PEP 814: Add frozendict built-in type

 — 
La Danse au Moulin-Rouge - Henri de Toulouse-Lautrec

In November 2025 at Pycon France (at Lyon), I watched the talk "Build a frozendict type (immutable dictionary)" by Antoine Rozo (video in French). It was a funny talk building a frozendict type in pure Python exploring different implementations such as a frozen dataclass with slots, frozenset, and super. See …

Category: cpython Tags:

Free Threading internals: PyMutex

 — 
Sunflowers - Vincent van Gogh (1888)

I'm writing an article series on Free Threading internals to learn more about Free Threading, explain how it works, and explain how it solved the "remove the GIL" issue where previous attempts failed.

PEP 703 replaces the unique Global Interpreter Lock (GIL …

Category: cpython Tags:

Free Threading internals: deferred reference counting

 — 
Banksy - Girl with balloon (2002)

I'm writing an article series on Free Threading internals to learn more about Free Threading, explain how it works, and explain how it solved the "remove the GIL" issue where previous attempts failed.

In the previous article, we have seen how the …

Category: cpython Tags:

Free Threading internals: reference counting

 — 
The Bride by Marc Chagall (1950)

I'm writing an article series on Free Threading internals to learn more about Free Threading, explain how it works, and explain how it solved the "remove the GIL" issue where previous attempts failed.

This first article explores the problem of tracking objects …

Category: cpython Tags:

PEP 782 – Add PyBytesWriter C API

 — 
The Secret World of Arrietty

In the Python C API, I dislike APIs modifying immutable objects such as _PyBytes_Resize(). I designed a whole new PyBytesWriter API to replace this _PyBytes_Resize() function. As usual in Python, it took multiple iterations and one year to design the API and to reach an agreement.

Picture: The Secret World …

Category: cpython Tags:

PEP 757 – C API to import-export Python integers

 — 
Ponyo movie

Design an API can take time. This article describes the design of the C API to import and export Python integers. It takes place between August 2023 and December 2024. In total, the discussions got more than 448 messages!

The API is a thin abstraction on top of CPython implementation …

Category: cpython Tags:

My Python commits: February 2025

 — 

Here is a report on my 18 commits merged into Python in February 2025:

  • Reorganize C API tests
  • Use PyErr_FormatUnraisable()
  • Reorganize includes
  • C API: Remove PySequence_Fast()
  • C API: Fix function signatures
  • C API: Deprecate private _PyUnicodeWriter
  • Documentation
  • Misc changes
Le Déjeuner des Canotiers by Auguste Renoir

Painting: Le Déjeuner des Canotiers (1881) by Auguste Renoir.

gh-93649: Reorganize …

Category: cpython Tags:

PEP 741: C API to configure Python initialization

 — 

PEP 741 story

The Starry Night (1889) by Vincent Van Gogh

Sometimes, writing a PEP can be a wild ride. It took two whole years between the early discussions and getting PEP 741 eventually accepted by the Steering Council. The API is only made of 18 functions, but it took more than 200 messages to design properly these …

Category: cpython Tags:

Add PyUnicodeWriter C API

 — 
La Danse - Matisse

In May, I designed a new C API to build a Python str object: the PyUnicodeWriter API. Many people were involved in the design and the discussion was quite long. The C API Working Group helped to design a better and more convenient API. It took me basically a whole …

Category: cpython Tags:

Status of the Python Limited C API (March 2024)

 — 
Ghibli - Spirited Away

In Python 3.13, I made multiple enhancements to make the limited C API more usable:

  • Add 14 functions to the limited C API.
  • Make the special debug build Py_TRACE_REFS compatible with the limited C API.
  • Enhance Argument Clinic to generate C code using the limited C API.
  • Add an …
Category: cpython Tags:

© Victor Stinner 2016

Powered by Pelican