[Python-Dev] Rename Include/internals/ to Include/pycore/

Victor Stinner vstinner at redhat.com
Sun Oct 28 17:30:53 EDT 2018

Le dim. 28 oct. 2018 à 21:50, Benjamin Peterson <benjamin at python.org> a écrit :
> I don't think more or less API should be magically included based on whether Py_BUILD_CORE is defined or not. If we want to have private headers, we should include them where needed and not install them. Really, Py_BUILD_CORE should go away. We should be moving away from monolithic includes like Python.h to having each C file include exactly what it uses, private or not.

I would prefer to avoid annoying with the backward compatibility.
Currently, #include <Python.h> more or less provides you "anything"
and I'm fine with that.

I prefer to no put too many changes at once :-)

My overall approach is to make sure that we don't leak functions by
mistakes into the public API or into the stable API anymore. For
example, if a function is really for the core, put it in pycore/. It
will be more explicit when reviewing a change for example.

Py_BUILD_CORE is not only used to select which functions you get.
Py_BUILD_CORE is also commonly used to get a macro instead of a
function call, for best performances.


More information about the Python-Dev mailing list