gh-141004: Document Py_ARRAY_LENGTH macro#141601
Conversation
Added documentation for the Py_ARRAY_LENGTH macro, explaining its usage and requirements.
|
Our CI does not like it when the branch the PR is opened from is called "main" IIRC and that is why some extra tests are running. |
Sorry, something went wrong.
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
|
Also, is it a generally good practice to break off a branch from the main while working on it myself then? |
Sorry, something went wrong.
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Removed redundant explanation of array size calculation.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
ZeroIntensity
left a comment
There was a problem hiding this comment.
Happy to see a new contributor :)
Sorry, something went wrong.
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Thanks, I've been hoping to contribute to python since the longest time tbh 😄 |
Sorry, something went wrong.
|
Please address my comments and then I'll merge this. |
Sorry, something went wrong.
I realize that VLAs also don't have a known size at compile-time.
ZeroIntensity
left a comment
There was a problem hiding this comment.
LGTM.
Sorry, something went wrong.
vstinner
left a comment
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
e0773ea
into
python:main
Nov 24, 2025
|
Thanks @Yashp002 for the PR, and @ZeroIntensity for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
Sorry, something went wrong.
(cherry picked from commit e0773ea) Co-authored-by: Yashraj <yashrajpala8@gmail.com> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
(cherry picked from commit e0773ea) Co-authored-by: Yashraj <yashrajpala8@gmail.com> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
gh-141004: Document `Py_ARRAY_LENGTH` (GH-141601) (cherry picked from commit e0773ea) Co-authored-by: Yashraj <yashrajpala8@gmail.com> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
gh-141004: Document `Py_ARRAY_LENGTH` (GH-141601) (cherry picked from commit e0773ea) Co-authored-by: Yashraj <yashrajpala8@gmail.com> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
This PR adds documentation for the
Py_ARRAY_LENGTHmacro to the C API documentation, addressing issue #141004.The documentation is placed in the "Useful macros" section of
Doc/c-api/intro.rstand includes:sizeof(array) / sizeof((array)[0])This macro has existed since Python 2.7 but was previously undocumented in the official C API documentation.
📚 Documentation preview 📚: https://cpython-previews--141601.org.readthedocs.build/