This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Kevin Mooney
Recipients Kevin Mooney, gaige, mcepl, ned.deily, ronaldoussoren, vstinner
Date 2020-05-18.23:25:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAAH7oK_Ywi04gR4R4=A6_rNJbTQUTG4OikzNb5jpr1FbMZhNkA@mail.gmail.com>
In-reply-to <1589839712.43.0.523406520227.issue39026@roundup.psfhosted.org>
Content
Ok, so there are three potential solutions

1. Add cpython_ prefix to cpython headers
2. Remove cpython/initconfig.h from cpython/pystate.h
3. Include initconfig.h rather than cpython/initconfig.h

1 intoduces verbosity and touches more than the other solutions. 2
introduces a dependency on the include order. 3 adds potential nasty
surprises. Doing nothing means C API users need to adapt their include
paths.

I'd appreciate your guidance on which path is preferable.

On Mon, 18 May 2020, 23:08 STINNER Victor, <report@bugs.python.org> wrote:

>
> STINNER Victor <vstinner@python.org> added the comment:
>
> I propose to rename "cpython/initconfig.h" to
> "cpython/cpython_initconfig.h".
>
> #include "cpython/initconfig.h"
>
> would become:
>
> #include "cpython/cpython_initconfig.h"
>
> So it becomes possible to include a cpython_xxx.h header from another
> cpython_xxx.h header (as done py cpython/pystate.h which includes
> cpython/initconfig.h).
>
> --
>
> Maybe a simpler change is simply to remove #include "cpython/initconfig.h"
> from cpython/pystate.h. Currently, cpython/pystate.h is included indirectly
> by Python.h at line 137, whereas cpython/initconfig.h is included by
> Python.h at line 135 (two lines before).
>
> C extensions must include "Python.h" first and when "Python.h" is used,
> pystate.h gets the cpython/initconfig.h definitions as expected.
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue39026>
> _______________________________________
>
History
Date User Action Args
2020-05-18 23:25:00Kevin Mooneysetrecipients: + Kevin Mooney, ronaldoussoren, vstinner, ned.deily, mcepl, gaige
2020-05-18 23:25:00Kevin Mooneylinkissue39026 messages
2020-05-18 23:25:00Kevin Mooneycreate