◐ Shell
clean mode source ↗

gh-140544: Always assume that thread locals are available by ZeroIntensity · Pull Request #140690 · python/cpython

@ZeroIntensity

@ZeroIntensity ZeroIntensity changed the title gh-140544: Always assume the HAVE_THREAD_LOCAL macro is defined. gh-140544: Always assume that thread locals are available

Oct 27, 2025
This fixes extensions that define Py_BUILD_CORE after including
Python.h, but before including pycore_pystate.h, such as mypyc.

kumaraditya303

@ZeroIntensity

kumaraditya303

kumaraditya303

@ZeroIntensity

kumaraditya303

StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request

Dec 6, 2025
…onGH-140690)

Python has required thread local support since 3.12 (see pythonGH-103324). By assuming that thread locals are always supported, we can improve the performance of third-party extensions by allowing them to access the attached thread and interpreter states directly.