Skip to content

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

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

Closed
rhansen opened this issue Oct 18, 2024 · 1 comment
Closed

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

rhansen opened this issue Oct 18, 2024 · 1 comment
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
JelleZijlstra added a commit to rhansen/cpython that referenced this issue Oct 30, 2024
@willingc willingc added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes and removed needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Oct 30, 2024
willingc pushed a commit that referenced this issue Oct 30, 2024
* gh-125674: Doc: Fix type of `newfunc` first parameter

* fixup! gh-125674: Doc: Fix type of `newfunc` first parameter

---------

Co-authored-by: Jelle Zijlstra <[email protected]>
picnixz pushed a commit to picnixz/cpython that referenced this issue Dec 8, 2024
…-125675)

* pythongh-125674: Doc: Fix type of `newfunc` first parameter

* fixup! pythongh-125674: Doc: Fix type of `newfunc` first parameter

---------

Co-authored-by: Jelle Zijlstra <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jan 3, 2025
…-125675)

* pythongh-125674: Doc: Fix type of `newfunc` first parameter

* fixup! pythongh-125674: Doc: Fix type of `newfunc` first parameter

---------

(cherry picked from commit 616468b)

Co-authored-by: Richard Hansen <[email protected]>
Co-authored-by: Jelle Zijlstra <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jan 3, 2025
…-125675)

* pythongh-125674: Doc: Fix type of `newfunc` first parameter

* fixup! pythongh-125674: Doc: Fix type of `newfunc` first parameter

---------

(cherry picked from commit 616468b)

Co-authored-by: Richard Hansen <[email protected]>
Co-authored-by: Jelle Zijlstra <[email protected]>
@erlend-aasland
Copy link
Contributor

Auto-merge enabled for backports. Closing as resolved; thanks!

erlend-aasland pushed a commit that referenced this issue Jan 3, 2025
#128449)

(cherry picked from commit 616468b)

Co-authored-by: Richard Hansen <[email protected]>
Co-authored-by: Jelle Zijlstra <[email protected]>
erlend-aasland pushed a commit that referenced this issue Jan 3, 2025
#128448)

(cherry picked from commit 616468b)

Co-authored-by: Richard Hansen <[email protected]>
Co-authored-by: Jelle Zijlstra <[email protected]>
ebonnal pushed a commit to ebonnal/cpython that referenced this issue Jan 12, 2025
…-125675)

* pythongh-125674: Doc: Fix type of `newfunc` first parameter

* fixup! pythongh-125674: Doc: Fix type of `newfunc` first parameter

---------

Co-authored-by: Jelle Zijlstra <[email protected]>
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
Status: Todo
Development

No branches or pull requests

3 participants