Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEP7: Need to add a info "PyAPI_DATA() macro" #2182

Closed
bobozi-cmd opened this issue Dec 4, 2021 · 1 comment
Closed

PEP7: Need to add a info "PyAPI_DATA() macro" #2182

bobozi-cmd opened this issue Dec 4, 2021 · 1 comment

Comments

@bobozi-cmd
Copy link
Contributor

When I read PEP7 and check Cpython source code, I found a deficiency that in https://www.python.org/dev/peps/pep-0007/#code-lay-out.
In this section, document said that

For external functions and variables, we always have a declaration in an appropriate header file in the "Include" directory, which uses the PyAPI_FUNC() macro, like this: PyAPI_FUNC(PyObject *) PyObject_Repr(PyObject *);

but when i check python 3.7.12+ and python 2.7.13, external variables actually uses the PyAPI_DATA() macro, like this:

PyAPI_DATA(PyTypeObject) PySuper_Type; /* built-in 'super' */

This may confuse beginners, could you please add this info in PEP7?

@brettcannon
Copy link
Member

Please feel free to submit a PR, but people should not be reading PEP 7 on how to write C extension modules, just how to format C code for CPython's code base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants