Skip to content

DOC: fix C API docs for PyArray_Size#28382

Merged
seberg merged 1 commit intonumpy:mainfrom
tylerjereddy:treddy_issue_10977_size_param
Feb 24, 2025
Merged

DOC: fix C API docs for PyArray_Size#28382
seberg merged 1 commit intonumpy:mainfrom
tylerjereddy:treddy_issue_10977_size_param

Conversation

@tylerjereddy
Copy link
Copy Markdown
Contributor

[skip azp] [skip cirrus] [skip actions]

* The actual C function signature is `PyArray_Size(PyObject *op)`,
and the compiler will issue a warning if you follow the current
C API docs that specify `PyArrayObject*`, so clean this up. I noticed
this while working on numpygh-28355, but it was also mentioned as an aside
7 years ago in numpygh-10977.

[skip azp] [skip cirrus] [skip actions]
@seberg
Copy link
Copy Markdown
Member

seberg commented Feb 24, 2025

Hah, the function actually includes a PyArray_Check, so object makes a lot of sense... But it returns 0 if it isn't an array :/ (which is a valid size of course).

Anyway, thanks!

@seberg seberg merged commit 40e6489 into numpy:main Feb 24, 2025
3 checks passed
@tylerjereddy tylerjereddy deleted the treddy_issue_10977_size_param branch February 24, 2025 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants