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

Wrong type for first parameter of newfunc C function type #125674

Open
rhansen opened this issue Oct 18, 2024 · 0 comments
Open

Wrong type for first parameter of newfunc C function type #125674

rhansen opened this issue Oct 18, 2024 · 0 comments
Labels
docs Documentation in the Doc dir

Comments

@rhansen
Copy link
Contributor

rhansen commented Oct 18, 2024

Documentation

The first parameter of the newfunc function type has type PyTypeObject *:

typedef PyObject *(*newfunc)(PyTypeObject *, PyObject *, PyObject *);

However, in a couple of places in the documentation it is shown as PyObject *:

+-----------------------------+-----------------------------+----------------------+
| :c:type:`newfunc` | .. line-block:: | :c:type:`PyObject` * |
| | | |
| | :c:type:`PyObject` * | |
| | :c:type:`PyObject` * | |
| | :c:type:`PyObject` * | |
+-----------------------------+-----------------------------+----------------------+

cpython/Doc/c-api/typeobj.rst

Lines 2647 to 2651 in a0f5c8e

.. c:type:: PyObject *(*newfunc)(PyObject *, PyObject *, PyObject *)
See :c:member:`~PyTypeObject.tp_new`.

Linked PRs

@rhansen rhansen added the docs Documentation in the Doc dir label Oct 18, 2024
rhansen added a commit to rhansen/cpython that referenced this issue Oct 18, 2024
@rhansen rhansen changed the title Wrong type for first parameter of newfunc function type Wrong type for first parameter of newfunc C function type Oct 18, 2024
rhansen added a commit to rhansen/cpython that referenced this issue Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

1 participant