Support free-threaded python 3.13+
Author: benfredCreated Oct 23, 2024Updated Jul 4, 2026
Python 3.13 adds the ability to have a free-threaded python interpreter - which doesn't have a GIL.
py-spy doesn't currently work against free-threaded python interpreters, because:
- PyObject layout is different : instead of just containing a
ob_refcntandob_typemembers - withPy_GIL_DISABLEDinterpreters the PyObject has additional members (threadid/mutex/ etc) MANAGED_DICT_OFFSETis different
Source: benfred/py-spy