New submission from STINNER Victor <vstin...@python.org>:

The PyUnicode_CHECK_INTERNED() macro uses the PyASCIIObject structure which is 
*excluded* from the limited C API:

/* Use only if you know it's a string */
#define PyUnicode_CHECK_INTERNED(op) \
    (((PyASCIIObject *)(op))->state.interned)

Using this macro in the limited C API doesn't work.

I propose to remove it from the limited C API.

IMO it's not a good idea to fix the function in the limited C API by converting 
it to a regular function hiding the implementation details and so working at 
the ABI level. We should not expose such "implementation detail" (if a string 
is "interned or not") in the *limited* C API.

----------
components: C API
messages: 407955
nosy: vstinner
priority: normal
severity: normal
status: open
title: [C API] PyUnicode_CHECK_INTERNED() doesn't work in the limited C API
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46007>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to