[issue46007] [C API] PyUnicode_CHECK_INTERNED() doesn't work in the limited C API

2021-12-09 Thread STINNER Victor


Change by STINNER Victor :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46007] [C API] PyUnicode_CHECK_INTERNED() doesn't work in the limited C API

2021-12-09 Thread miss-islington


miss-islington  added the comment:


New changeset 73325bbe774b16891f999fb557177206470676b1 by Victor Stinner in 
branch 'main':
bpo-46007: Exclude PyUnicode_CHECK_INTERNED() from limited C API (GH-29987)
https://github.com/python/cpython/commit/73325bbe774b16891f999fb557177206470676b1


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46007] [C API] PyUnicode_CHECK_INTERNED() doesn't work in the limited C API

2021-12-08 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +28210
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29987

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46007] [C API] PyUnicode_CHECK_INTERNED() doesn't work in the limited C API

2021-12-08 Thread Petr Viktorin


Petr Viktorin  added the comment:

+1, PyUnicodeObject/PyASCIIObject is excluded from the limited API since Python 
3.2, so it wasn't possible to use this macro.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46007] [C API] PyUnicode_CHECK_INTERNED() doesn't work in the limited C API

2021-12-07 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +petr.viktorin

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46007] [C API] PyUnicode_CHECK_INTERNED() doesn't work in the limited C API

2021-12-07 Thread STINNER Victor


New submission from STINNER Victor :

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com