We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Py_ARRAY_LENGTH
1 parent bf66bce commit e0773eaCopy full SHA for e0773ea
1 file changed
Doc/c-api/intro.rst
@@ -322,6 +322,19 @@ complete listing.
322
PyDoc_VAR(python_doc) = PyDoc_STR("A genus of constricting snakes in the Pythonidae family native "
323
"to the tropics and subtropics of the Eastern Hemisphere.");
324
325
+.. c:macro:: Py_ARRAY_LENGTH(array)
326
+
327
+ Compute the length of a statically allocated C array at compile time.
328
329
+ The *array* argument must be a C array with a size known at compile time.
330
+ Passing an array with an unknown size, such as a heap-allocated array,
331
+ will result in a compilation error on some compilers, or otherwise produce
332
+ incorrect results.
333
334
+ This is roughly equivalent to::
335
336
+ sizeof(array) / sizeof((array)[0])
337
338
339
.. _api-objects:
340
0 commit comments