jcrist / msgspec

A fast serialization and validation library, with builtin support for JSON, MessagePack, YAML, and TOML
https://jcristharif.com/msgspec/
BSD 3-Clause "New" or "Revised" License
2.09k stars 61 forks source link

Use multi-phase init for c-extension initialization #563

Open jcrist opened 9 months ago

jcrist commented 9 months ago

Description

msgspec currently uses the old style single-phase init for module import. We should transition to use the newer multi-phase init process. Besides code quality, this is one of the steps required for us to make use of the new per-interpreter GIL subinterpreters feature in CPython 3.12.

Some relevant resources: