Thought - yes. Done anything - no.
> Right now I'm thinking we have three distinct cases: includefiles users
> may need to include directly (Python.h and perhaps a select few others),
> includefiles that Python.h may need (but probably shouldn't pollute the
> global include "namespace"), and includefiles that are just for CPython
> source (and tightly coupled extension modules) and which shouldn't even
> be installed by 'make install'.
My approach would be different: leave all the files as they are, but
instead hide parts of it in #ifdef blocks.
Of course, it might be also possible to reorganize the files, but I
would consider this secondary (for my objective - which is to provide
a stable ABI).
> For the second category, a subdirectory seems ideal to me, although a
> Python-specific prefix on the names probably works fine too. For the
> third we probably want a separate subdirectory, say, 'internal', as that
> will make it easier to not install those files.
Ok, so this is about pollution of the #include space. Is that really
a problem that needs to be solved?
If so, I think there should be exactly two header files that either
embedding applications or extensions modules might include:
Python.h, and pyconfig.h. If an application legitimately needs to
include anything else, I would consider that a bug (in Python.h)
For the files included from Python.h, either moving them to a
subdirectory, or renaming them sounds fine to me.
> Any thoughts on this issue?
I don't think the #include space is a tight resource. If we
learn about a conflict with a specific file, we could always
rename ours.
OTOH, for the stable ABI, the names of the header files don't
matter. What matters more is
a) what functions extension modules call - certain "internal"
functions should be hidden (e.g. support routines for
frames, code objects, and the like)
b) what structures they access (PyObject fields are public,
anything else should be private)
Regards,
Martin