STINNER Victor <vstin...@python.org> added the comment:

* Include/internal/ with extern: C API which must not and can not be used 
outside CPython code base, only stdlib extensions built as built-in extensions 
can use it.

* Include/internal/ with PyAPI_FUNC/PyAPI_DATA: API which should be be used 
outside CPython, but exposed for specific use cases like debuggers and 
profilers. Structures are exposed for debuggers and profilers which don't want 
to execute code to avoid the risk of any unwanted side effect.

* Include/cpython/: Public C API excluded from the limited C API 
(Py_LIMITED_API macro) and the stable ABI (PEP 384).

* Include/: Public limited C API and the stable ABI (PEP 384).

In case of doubt, new C API must be added to the internal C API using extern.

I would suggest a public discussion before adding any new C API to 
Include/cpython/ or Include/

No new functions stealing references or returning borrowed references must be 
added to public C API (limited or not). A strong reference must be returned.

----------

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

Reply via email to