Closed
Description
Feature or enhancement
The _PyUnicode_Name_CAPI
provides functions to get the name for a given Unicode character code and vice versa. It is lazily initialized and stored in the per-interpreter _Py_unicode_state
:
cpython/Include/internal/pycore_unicodeobject.h
Lines 425 to 432 in 3932b0f
The initialization of the ucnhash_capi
isn't thread-safe without the GIL. (There can be a data race on reading and writing ucnhash_capi
).
Mostly for my own reference, here are the similar modifications in the nogil-3.12
fork: colesbury/nogil-3.12@5d006db9fa