We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 85f3009 commit 424d959Copy full SHA for 424d959
Doc/c-api/structures.rst
@@ -730,6 +730,21 @@ Macro name C type Python type
730
731
Always ``None``. Must be used with :c:macro:`Py_READONLY`.
732
733
+ .. c:macro:: Py_ARRAY_LENGTH(array)
734
+
735
+ Compute the length (number of elements) of a statically allocated C array at
736
+ compile time.
737
738
+ The *array* argument must be a C array with a size known at compile time,
739
+ not a pointer. Using this macro with a pointer will produce incorrect results.
740
741
+ This macro is defined as::
742
743
+ #define Py_ARRAY_LENGTH(array) (sizeof(array) / sizeof((array)[0]))
744
745
+ .. versionadded:: 3.13
746
747
748
Defining Getters and Setters
749
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
750
0 commit comments