# C API: How much private is the private \_Py\_IDENTIFIER() API?

**URL:** <https://discuss.python.org/t/c-api-how-much-private-is-the-private-py-identifier-api/29190>\
**Category:** C API\
**Created:** [July 7, 2023, 4:26pm UTC](https://discuss.python.org/t/c-api-how-much-private-is-the-private-py-identifier-api/29190 "2023-07-07T16:26:36Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![encukou](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/encukou/32/2461_2.png) [@encukou](https://discuss.python.org/u/encukou)\
**Post date:** [August 31, 2023, 2:17pm UTC](https://discuss.python.org/t/c-api-how-much-private-is-the-private-py-identifier-api/29190/8 "2023-08-31T14:17:27Z")

</div>

> [@vstinner](#):
>
> If the number of affected projects is low, the solution is to guide them towards static/global variables to cache strings (call `PyUnicode_FromUnicode()` only once)

That would be incompatible with multiple interpreters. Could you guide them to use module state instead of C statics/globals?

Maybe we do need an API to atomically create/get an immortal string that’s interned across all interpreters.

---

_[View the full topic](https://discuss.python.org/t/c-api-how-much-private-is-the-private-py-identifier-api/29190)._
