On Fri, Sep 20, 2019 at 2:58 PM Vinay Sajip via Python-Dev
<python-dev@python.org> wrote:
>
> > > Right, I'm pretty sure that right now Python doesn't have any way to
> > share symbols between .c files without also exposing them in the C
> > API.
>
> On other C projects I've worked on, the public API is expressed in one set of 
> header files, and internal APIs that need to be exposed across modules are 
> described in a different set of internal header files, and developers who 
> incorrectly use internal APIs by including the internal headers could see 
> breakage when the internals change ... excuse my naïveté, as I haven't done 
> much at Python's C level - does this discipline/approach not apply to CPython?

Visibility in C is complicated :-). The level I'm talking about is
symbol visibility, which is determined by the linker, not by headers.
If a symbol is exported, then even if you hide the headers, it's still
part of the library ABI, can still collide with user symbols, can
still by accessed by determined users, etc. It's still fixable, but it
requires some newer tools like -fvisibility=hidden that work
differently across different platforms, and so far no-one's done the
work to sort out the details.

-n

-- 
Nathaniel J. Smith -- https://vorpus.org
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/GOQDPXFWEBQT7DDQKHHGHWZQMTOG2COI/

Reply via email to